Arduino Mega (with MIDI Shield) Inserted in Place of the Key Assigner's 8049 Microprocessor |
OK, stepping back to the proper place in the story, the last work that I had reported was on extracting the timing of the control signals generated by the 8049 microprocessor that is at the heart of the Polysix's key assigner. My plan is to replace the 8049 with an Arduino, so I needed full knowledge of all the control signals. Since that post, I've begun developing software for an Arduino Mega 2560 to recreate all of the control signals generated by the Polysix's 8049. That work has been going well, so I felt that it was time to actually start plugging into the Polysix...it was time to make the rubber hit the road.
To physically get the control signals from the key assigner PCB to the Arduino (and back), my plan is pop the 40-pin 8049 out of its DIP socket in the Polysix and to connect a bunch of wires between the Arduino and the now-empty socket in the Polysix. Basically, this is a less elegant version of same approach used by these folks, who are replacing the microprocessor in a Prophet 600 with another type hobbyist microprocessor, the Teensy++. Whereas the Teensy already comes in a nice 40-pin DIP form and can be dropped directly into the Prophet 600 board (with a minor mod), the pin-out for the Polysix is radically different -- too different to enable easy use of the Teensy. So, unfortunately, I'm stuck using the much-larger Arduino Mega.
To get the wires from the empty 8049 socket on the Polysix PCB to the Arduino, I've chosen to take a new 40-in DIP socket, to solder a bunch of wires to it, and to insert the newly-wired socket into the empty 8049 socket. Unfortunately, as you can see in the picture below, a plastic DIP socket isn't really meant to be soldered to -- you can see in the picture that the plastic around each soldered pin got quite melted. It would be really easy to push a pin right on through the socket's frame. Be careful!
Soldering a Wires to a Soft-Plastic 40-Pin DIP Socket |
Of course, you just can solder wires all willy-nilly -- you have to have a plan of which pin from the 8049 socket is needed for what purpose. So, after looking at the Polysix schematic, I came found that I needed 27 wires to attach to 27 of the 8049's connections (see my hand-drawn pin-out below). Add another wire for power and another for ground and that's a total of 29 connections. With that number of connections, you can see why I needed an Arduino Mega instead one of the more-common (and cheaper) Arduino variants.
Signals from the Polysix 8049 that I Need to Bring to the Arduino Mega |
My Colorfully-Wired DIP Socket Inserted in Place of the Polysix 8049 Processor. |
Did it work? Well, no. Software always has bugs. Did it work eventually? Yes. Totally.
As of right now, I've got the following Polysix functions working correctly: Poly, Unison, Chord, Hold, and the Octave knob. The only Key Assigner mode that is not yet implemented is the Arpeggiator. I even have a few new functions already implemented: (1) a sustain pedal, and (2) user toggling between retrigger every note (like a normal Polysix) and no-retrigger when playing legato (like a Moog). I'm particularly enjoying the sustain pedal functionality.
Now that I've demonstrated that it works, the next step is to begin to install it more permanently into the Polysix. Then, I can install the new keybed (along with its controller). At that point, I can finally start implementing the aftertouch and velocity sensitivity. What a long road!
Update: Here's the next step...the New Keybed with my Arduino Key Assigner
Update: I finally shared my Arduino code here.
amazing! did you install the Fatar keyboard yourself?
ReplyDeleteHi! Thanks for the complement. Yes, I installed the Fatar keybed myself. Yes, the end product would probably be more robust if I paid a keyboard technician to do the work, but I like the challenge and knowledge that comes from doing it yourself.
ReplyDeleteHi Chip, wouldn't a Teensy++ 2.0 have worked as well since it has tons of pins?
ReplyDeleteProbably would have worked fine...but I'm a noob, so I wanted to stick with Arduino. I got a little bit burned when I went with the Arduino-like Maple board, which was lacking some library compatibility. So, I stuck with a core Arduino board. The Mega is a lot more expensive than the Teensy 2.0++, so I should have given it a 2nd look.
DeleteThere are couple small things that the Mega has that the Teensy doesn't: (1) the Mega has mounting holes and the Teensy doesn't, (2) the Mega has extra holes for ground and for +5V for supporting peripherals and switches and stuff. That's kinda helpful. Probably not worth all the extra money, but still kinda nice.
What is nice about the Teensy is that it has holes and not headers. I had to desolder the Mega headers, or just use wires and tape them in place. It would have been a lot nicer to just solder a wire into the hole. Much nicer. Totally nicer.
Thanks for reminding me of the Teensy!
Hi Chip,
ReplyDeletei would like to change my Key assigner by Arduino Mega,
could you help me please?
Chris from France
Before you dive in, you need to recognize that one of the Key Assigner's important jobs is to scan keybed to look for key presses. When I replaced the Key Assigner, I also chose to replace the keybed. Since my new keybed came with electronics, it simply output MIDI. Therefore, my new Key Assigner did not need to scan the keybed.
DeleteIf you are going to use the Polysix's keybed, you will need to program the Mega to also scan the keybed. I did not do that with my Mega, so I can't help you figure that part out.
Chip
Ok chip, in first time i will use midi keybaord.
ReplyDeleteBut what type of signals did you send in pin DB0 to DB7?
My problem is to reorganize input signal pin 5 of TL072 IC9...
Chris
DB0 to DB7 are either digital high or digital low (0 or 5 volts). Those high/low values go into that resistor network and summing op-amp, which together act like a digital-to-analog converter (DAC). Therefore the input to pin 5 is an analog voltage.
DeleteThe trick is that all six voices are multiplexed in time as described in one of my other posts: http://synthhacker.blogspot.com/2013/02/polysix-basic-key-assigner-timing.html
You are going to need an oscilloscope in order to get enough information do this modification. You're going to have lots of questions like this, and my replies will not be adequate (just as this reply isn't really adequate). Then, once you actually do the modification, you are going to need an oscilloscope to figure out why it doesn't work. If you do not have an oscilloscope (or if you cannot borrow one), I would not start this modification...you will just end up with a Polysix that does not work.
Hi,
ReplyDeleteI have an oscilloscope and logic analyzer. I read your post based on timing. Very good and my result is same.
For now, I don’t know how to organize signal output of DB0-DB7 for multiplex. What sort of signal have you used for this?
On original CPU, signals DB0 to DB7 are numeric and change each key press.
For now is a mystic!
I will do some tests
All function of P6 work with your Arduino?
Thanks for your help!
Chris
The signals for DB0-DB7 are arranged as a binary counter. Pressing the lowest note on the keyboard results in 00000000. Press the 2nd note yields 00000001. Press the 3rd note yields 00000010. Etc. That's the general idea...though the whole thing could also be reversed (replace all zeros with ones)...I can't remember.
DeleteYou could hook up your oscilloscope (or your logic analyzer), put your P6 into unison mode and press a key. Then, probe each pin DB0-DB7 to see what you get. Then press the next key and see what you get. After a few key presses, you should be able to quickly work out the pattern.
Note that my Arduino code is now available: http://synthhacker.blogspot.com/2014/03/polysix-sharing-my-arduino-code.html