Sunday, March 31, 2013

Mono/Poly - Audio Comparison of the Sizzle Mod

In this post, I showed how I modified my Korg Mono/Poly to boost the very highest frequencies to add a little more "sizzle" to its sound.  Because I'm lazy, I tried to get away without posting any sound clips of my modifications.  Well, I knew that I wouldn't really be able to get away with that kind of laziness.  I did have a couple of people ask me for some audio.  I've never posted a sound comparison before, so I'm hoping that this works.  Here's a comparison via YouTube....

Are you able to hear the difference due to the modification?  This was recorded directly out from the Mono/Poly into my M-Audio recording device.  VCO1 only, sawtooth waveform, filter wide open, no resonance.  To my ears, both the stock and the modified versions have lots of good "buzz", but the modified version has (to me) a little extra brain-tingling sizzle to it.  Hopefully, the YouTube audio compression still allows that extra little tingly sizzle to come through. (Note: when I play this video on YouTube, a weird hashy noise comes in around 0:45...that's YouTube, not my synth.)

Now, we should talk about the effect of subtle changes in sound.  In the demo above, maybe you'll hear the increased sizzle and buzz.  Or maybe you won't.  Or, maybe you'll say that the original version sounds better because it sounds more balanced, whereas the modified version has too much sizzle.  That's a fine opinion.  An important part of this equation is what sound reproduction equipment I use.  Recording straight from the keyboard into the computer (or M-Audio recorder, in this case) is not how I normally play, so the recordings in the video above are not representative of my everyday experience of how I hear my keyboard.

When I play, I play live through a keyboard amplifier with a big speaker (Roland KC-550).  Sure, there are higher-fidelity sound systems out there, but I just like that live feel where the bass from a big speaker really rumbles your guts.  The KC-550 has that.  Unfortunately, through this keyboard amp, the sizzle that you hear  in video for the stock Mono/Poly is often not apparent...the sizzle gets lost in the amp, or in the room, or in the off-axis orientation of my head relative to the amp.  With this modification, though, the extra sizzle makes it to my ears...and it makes me smile.  So, for me, the subtle 3-6 dB of added high frequencies makes a small but pleasurable difference.

Maybe six months from now, though, I'll be complaining about how I hate the sound.  I'll say that the extra high-treble is too fatiguing.  That would be so me.  I am a human being after all.  Very fickle.  :)

Thanks for checking it out!

Friday, March 29, 2013

Mono/Poly - Treble Boosting "Sizzle" Mod

After my recent successes with my mods to my Korg Polysix, I finally took some time to play my Mono/Poly again.  While I had a great time playing it again (such a big smile on my face!), the experience also reminded me how I wish that she had a bit more "sizzle".  Previously, I compared my Mono/Poly to my Polysix and confirmed that my Mono/Poly does indeed have less high frequency content than my Polysix.  So, my mission was clear...can I recover the sizzle in my Mono/Poly?  Well, after over-thinking this problem for way too long, I finally found a super-easy way of doing it.

My "Sizzle" Mod -- One Resistor and One Cap

The figure below was the key finding from by Mono/Poly vs Polysix comparison.  It clearly shows that the Mono/Poly is clearly missing some of the highest "sizzle" frequencies compared to the Polysix.  To put some numbers to this graph, the Mono/Poly is lower by 3dB at 4 kHz and it's lower by 10 dB at 10 kHz.  Now I have a quantitative target...boost the treble with a 3dB point at 4 kHz.  Let's go!

Measurements Comparing the Frequency Content Sawtooth Wave on My Polysix vs My Mono/Poly

Previously, I tried adjusting the Mono/Poly's VCF and achieved a slight improvement in the Mono/Poly's highest frequencies, but not enough.  I then dived into the internal signals isolated the high-frequency loss to somewhere in the VCF or VCA, but not in the VCOs and not in any of the circuitry that follows the VCA.  Having partly isolated its location, I assumed that I'd begin the detailed process of trying to find the broken component that might be causing the high-frequency roll-off.  While that's a noble goal, it then occurred to me that I could just take the easy way out and artificially boost the high frequencies in order to flatten out the synth's overall response.  That would be easy.

The easiest way would be to turn up the "Treble" knob on my keyboard amp.  That worked great until I got my Polysix and was running it through the same amp.  Cranking the Treble knob on the amp makes the Polysix way too hissy.  As a result, I now something that'll boost the treble on just the Mono/Poly.  Sure, I could add an EQ pedal, but that's more clutter.  It would be best if I could just add a bit of circuitry to the Mono/Poly and be done with it.

So, looked around the Mono/Poly's schematic and found a really nice-looking target for adding a little high-frequency emphasis.  Specifically, just before the VCF, there's a simple voltage divider that provides the massive amount of attenuation (50 dB!) necessary to get the signal level down to tiny level necessary for the input to the SSM 2044 filter IC.  As shown below, simply adding a resistor and a cap together around the 47K resistor in that voltage divider should result in a nice little treble boost.

Circuit Modification to the KLM-355 Board to Boost the Sizzle of my Mono/Poly
To get the specific values for theadd  resistor and cap, I used a circuit simulator (5Spice Analysis) to predict the effect of different component values.  As I said earlier, I was targeting a boost of 3 dB at 4kHz.  After a bunch of trial and error, I settled on the 5kOhm resistor and a cap that was in the neighborhood of 1nF.  The graph below is the output from 5Spice, which says that a 750 pF would be an even better choice because it yields +3.3 dB at 4kHz.  Unfortunately, I didn't have a 750 pF...I only had a 1000 pF (aka 1nF aka 0.001uF) on hand, so that's what I used.  Given the wide tolerances band on real-world caps (10-20%?), this analysis is all approximate anyway.
Expected Response of the Sizzle Mod Using Either a 1000pF or a 750pF Capacitor

After soldering in the resistor and cap (see picture at the top of this post...ugly!), I fired up the synth and measured the actual frequency response resulting from the modification.  The figure below shows that this mod did indeed boost the high frequencies quite nicely!

Measured Response of the "Sizzle" Mod to the Mono/Poly Relative to the Stock Mono/Poly

Now, to loop back around to the beginning, did I achieve my goal of giving the Mono/Poly a "sizzle" that is similar to my Polysix?  Well, if you care to believe in graphs (I do, obviously), the graph below compares the Mono/Poly's new response to my Polysix.  Check out those high frequencies...they're lined up stunningly well.  Mission accomplished!

Measured Response of the Modified Mono/Poly to my Polysix.  Mission Accomplished!
At this point, I'd love to present to you a sound sample comparing the modified to the unmodified Mono/Poly.  Unfortunately, I don't yet have a SoundCloud or anything for sharing audio.  So, while I could share it via YouTube, we all know that their audio compression can really mess with subtle and fine details of synth recordings.  So, sadly, I've got no sharing of sound right now.  Sorry!

Given how simple this mod is, though, maybe you should just give it a try yourself!  Smell the solder!

Update: I was guilted into posting some sound samples.  Check it out!

Thursday, March 28, 2013

Polysix - Aftertouch and Portamento Demo

This last week has been an exciting time for my pursuit of adding aftertouch to my Korg Polysix.  As you know by now, I *really* want aftertouch vibrato on my a while back, I ordered a bunch of parts and dived in. I've been posting about my progress.  In my last post, I described the electronics elements that I used to implement the arbitrary pitch bending that would allow for my aftertouch-driven vibrato.  As a bonus, having arbitrary pitch control also enabled me to add portamento to my Polysix, which is another effect that I absolutely love.  So, without further ado, now that I've put her back together, here's my first demo of what she can do...

How did I make this happen?  Well, the block diagram below shows the elements.  I bought an aftertouch-enabled Fatar keybed from Keyparts UK.  I bought their custom keyscanner, too, which scans the keybed and generates MIDI messages.  I then use an Arduino Mega to parse the MIDI messages and to drive the Polysix's electronics.  It interfaces with the Polysix by replacing the Intel 8049 microprocessor that is at the heart of the Polysix's "Key Assigner" circuit.  This this digital interface, I can control what note they Polysix is sounding.  To get the arbitrary pitch bending for the aftertouch vibrato and for the portamento, I generate an analog pitch control voltage (CV) using a digital-to-analog converter (DAC) from Adafruit.  I inject that signal at a pitch CV summing node that it already built into the Polysix.  After writing a bunch of code to run on the Arduino and after debugging these hardware elements, she works pretty well!

How I'm Implementing Aftertouch and Portamento
For a user interface, I'll eventually need to add some switches and knobs to the front panel of the Polysix.  For the moment, though, I've chosen to re-purpose the knob and switches that are supposed to be used to control the arpeggiator.  Since these particular elements are scanned by the Polysix's Key Assigner, and since I just replaced the Key Assigner with my Arduino, I now have total control over these particular user interface, I can make them do whatever I want.  For the moment, I'm going to use them for my aftertouch and portamento.

As you can see in the image below, I chose to make the arpeggiator "Speed" knob control my software LFO, which is driving my aftertouch vibrato.  The blinking of the LED still works to show the speed of my aftertouch vibrato!  I then use the arpeggiator "Range" switch to set the sensitivity of the aftertouch response.  Portamento is activated or deactivated using the "Latch" switch, while the amount of portamento is set using the "Arpeggiator Mode" switch.  Now I'm not saying that this is an intuitive user interface, but it sure is nice being able to use these elements to control my new features without having to cut into my Polysix panel.

Re-purposing the Arpeggiator Controls for Use with my Aftertouch Vibrato and my Portamento
So, I'm pretty excited about how she's working.  There are certainly more tweaks and adjustments to make, but the basics are all in place.  In fact, now that it's working, I don't seem to spend any time tweaking the electronics anymore...I just spend all my time playing.  I guess that's kinda the point, though.  :)

More updates later...when I get tired of playing!

Update: Here's more info on re-using the arpeggiator "Speed" knob to control the aftertouch vibrato speed
Update: Mounting the Arduino in the Polysix
Update: Tuning the Aftertouch Response Curves
Update: Tuning the Portamento Based on the Mono/Poly
Update: Adding detuning to the Polysix
Update: Added a sustain pedal to the Polysix
Update: I shared my Arduino code here
Update: I added Velocity Sensitivity to my Polysix.

Saturday, March 23, 2013

Polysix - Arduino and DAC to Bend the Pitch

Earlier in the week, I'd made good progress on getting the new keybed and keyscanner into shape so that it could drive my Korg Polysix via an Arduino.  While it was exciting to simply get the keybed to work in the Polysix, that was not really my goal.  My real goal is to use the new keybed to enable aftertouch (and eventually velocity sensitivity) in my Polysix.  Now is the time when I make the bits between the Arduino and the Polysix so that the aftertouch actually does something.  This is where I make the Arduino have arbitrary control over the pitch of the Polysix's voices.

Creation is a Messy Process!
The first step is to make sure that I have a clear idea of what my approach is going to be for the aftertouch to command pitch on the Polysix.  Below is a block diagram showing the major components that I settled on and how they connect.

Here's How I Am Implementing Aftertouch
Listening for MIDI Aftertouch:  User, of course, is interacting with the keyboard via the keybed.  The keybed is connected to the keyscanner (both from Keyparts UK), which looks for which notes are pressed on the keybed.  The keyscanner outputs the notes via a MIDI stream, which is received by an Arduino Mega.  The MIDI stream includes the "note on" and the "note off" messages, as one would expect.  The keyscanner, though, also reads the aftertouch pressure sensor built into the keybed.  Therefore, the MIDI stream also contains the aftertouch commands.  So, after getting the keybed and keyscanner and Arduino hooked together, I used the Arduino to listen to the MIDI stream to ensure that the aftertouch messages were present.  They weren't.  After exchanging a few emails with the good folks at Keyparts, they sent me a new software build for the keyscanner (uploaded to the keyscanner using a very nice and very simple method via USB), which solved the problem.

Aftertouch for Vibrato:  With the aftertouch messages successfully reaching the Arduino, now the question is what to do with the messages.  In modern synths, the aftertouch can be mapped to a range of functions.  For me, I want to start simple -- I just want the aftertouch to create vibrato, much like what the mod wheel currently does.  The key is that I somehow need to command a smoothly-changing pitch from the Polysix.  I could implement this in a whole bunch of ways (and I even tried a couple).  Instead of going through the whole list that I came up with, I'm just going to talk about what ended up being successful.

Polysix Pitch CV:  First, let's talk about how the stock Polysix creates each note's pitch.  In the polysix, the sound that you hear starts with the VCOs (one for each voice).  The VCO is told what pitch to create via an analog voltage signal that is between 0 to +5V.  This is the "Pitch CV".  In a stock Polysix, the 8049 key assigner has 8 output pins, which are connected to an R-2R ladder circuit (a type of digital-to-analog converter) to create the Pitch CV (see schamtic below).  For each note being played by the Polysix, the 8 output pins of the 8049 are set in a particular combination of high (5V) or low (0V) states so that the correct CV value is created for the pitch that you want.  While it is a very nice system, it can only generate pitches that are precisely on the note you want -- it cannot create any pitches that are in-between notes.  As a result, I cannot exploit this circuitry to create the smoothly-varying pitches that I want for my aftertouch.

R-2R Ladder Used by the Polysix to Make Each Note's Pitch Control Voltage (CV)
DAC for Adjusting Pitch:  My solution is to use my own digital-to-analog converter (DAC) to create as smoothly-varying as a Pitch CV as I can. Granted, any DAC can only produce discrete voltages, but if the DAC has sufficient resolution (enough bits) then your ear will be tricked into hearing smoothly-varying pitch.  For expediency, I chose to use this product from Adafruit, which is an MCP4725 12-bit DAC mounted on a nice break-out board.  It's a fine device, but the best part is that Adafruit provides an easy-to-use software library for use with the Arduino.  It took zero debugging to get this to work.

DAC to Generate Pitch CV:  Ideally, I would have been able to use the DAC alone to be my sole device for create the Pitch CV in the Polysix.  In theory, it should have made the R-2R ladder unnecessary.  Unfortunately, when I actually tried to use the DAC this way, the pitches didn't sound right and weren't stable as I'd like.  So, either 12-bits isn't enough resolution for the full 10 octave span, or my use of it wasn't quite right.  Regardless, I abandoned the use of the DAC as sole generator of the Pitch CV and went to a hybrid approach.

Using both the DAC and the R-2R Ladder:  In my hybrid approach, I return to using the R-2R ladder for the main part of the Pitch CV and use the DAC to provide a tweak to the Pitch CV to bend the pitch one way or the other.  To implement this hybrid approach, I needed to find a summing junction in the Polysix circuit that could be used to mix the DAC's CV with the R-2R's CV.  After trying a bunch of spots (including where the bend wheel injects its signal), I settled on injecting the DAC CV right after the R-2R ladder, at the junction of R33 and R34 (see schematic above).

Connect via 10K Resistor:  An important detail is that the 0-5V DAC signal must connected to this location via its own 10K resistor.   This makes the electrical summing at this junction scale correctly.  The reason that you need a 10K is that, for simplicity, I'd like our 0-5V DAC output to have the same pitch scaling as the 0-5V output of the R-2R ladder.  Since the R-2R ladder connects to this summing junction via 10K, then we should connect via 10K, too.  A second reason for the 10K is that the R-2R ladder uses +5V to represent the lowest note and 0V to represent the highest note.  So, we can call +5V to be the reference voltage with the higher pitches going down from there.  This is fine except that the VCOs can't work with that signal.  They need something more like 0V with higher pitch going up from there.  So, the designers included this summing junction using the -15V to strip off the +5V reference (see how the ratio of 10K to 30K is important!) and, by entering at the "-" input, the sign of the CV gets flipped.  It just so happens that this summing junction is a great place for us to inject our DAC signal as long as we connect via 10K and as long as we make our DAC output with a 5V reference where increasing pitch requires the DAC to put out a lower voltage value.  The 10K resistor is easy, and the rest we do in software on the Arduino.

Real-World Implementation of Hybrid Pitch Control Via the 8049 Pins Plus DAC
Wiring it All Together:  The picture above shows the messy real-world wiring for all of these bits and pieces.  It shows the rainbow-colored ribbon of wires going from the Arduino to the 8049 socket.  It also shows the DAC signal getting injected at R33/R34 via the black clip-lead.  Sure, it's ugly, but it works!  Well, I should say that, after a whole bunch of debugging of my software whatnot, it works!  I can receive MIDI messages from the keyscanner, interpret them in the Arduino, command the main part of the pitch via the 8049 socket, and command pitch adjustments (such as vibrato) via the DAC.  Nice!

Next Steps:  As shown in the very first picture at the top of this post, my system may function, but it is barely holding itself together.  Also, you'll notice that I've not yet included any demos...that's because there is still a big distance between being able to generate arbitrary pitches (including those critical in-between pitches) and getting a useful aftertouch-driven vibrato.  So, in my next posts, I'll talk about implementing the aftertouch vibrato (with portamento as a bonus!) and about my approach for cleaning up all that wiring so that the installation is a bit more permanent.  Stay tuned!

Update: Here's a demo once the synth was buttoned-up for the first time
Update: Mounting the Arduino in the Polysix
Update: The flexibility of this system also let me add detuning to my Polysix

Thursday, March 21, 2013

Polysix - Boosting the New Keybed

As discussed in this post, my new Fatar keybed had too many feet and, overall, its height was a bit too short.  So, in the previous post, I showed how I cut the feet off so that it wouldn't interfere with the circuit boards in the Polysix.  In this post, took care of the height problem so that it stood tall enough to extend over the circuit boards.

Hack-Sawing a Long Plastic Bar into Pieces for my Keybed Booster
After cutting a few of the feet off the keybed, I sat it inside m Korg Polysix and saw that it was still resting on the circuit boards.  Obviously, that's a bad thing.  So, I removed the new keybed and set it next to the old keybed.  It was clearly shorter.  How did I not notice this before?  Luckily, boosting it up seemed pretty straight forward.

I measured that the new keybed needed to be boosted by about 3/8" to match the old one.  So, I bought a four-foot-long piece of plastic from McMaster-Carr (part # 9123K76, Delrin, 4 feet x 1 inch x 3/8").  Then, I measured out the approximate length of the pieces that I'd need -- one long piece for the front feet and two short ones for the back feet (to leave a big space in the back for the Polysix's circuit boards to fit between the legs.  After hack-sawing the plastic bar (see pic above), I placed the keybed on the plastic pieces just to make sure everything looked OK.  As you can see in the pic below, so far everything looks fine.

Placing the Keybed on the New Plastic Pieces to Check the Fit
At this point, the story gets a bit more complicated because these plastic booster pieces also have to address a second problem that I have: the Polysix doesn't really have enough space for all the extra electronics that I want to put inside.  To get everything in there, I'll have to utilize the space under the keybed.  One piece that can go under there is the controller board that'll do the keybed scanning.  I got the controller board from the folks at Keyparts UK when I bought the keybed itself.  It looks like a great board.  My idea is to mount it under the keybed by screwing it to my white plastic pieces.  Below shows a test fit, including with the aftertouch sensor strip plugged in.  It's a tight fit, but it looks like it'll work!

Test Fit with the Keybed Scanning Electronics In-Place.
Since it looked like it was going to work, I started drilling holes and screwing things together.  First, I started with attaching the controller board.

Securing the Keybed Controller Using Screws.  (Notice that I set everything onto a piece of wood 2x4 to catch the drill bit once it passes through the plastic.  Don't let the drill dig into your actual work surface!)
Once that was secured, I started drilling holes and attaching the plastic pieces to the feet of the keybed.  To get it right, this took a lot of measuring and re-measuring.

Screwing the Plastic Booster Pieces to the Feet of the Keybed
All along the way, it was critical to keep doing test-fits into the Polysix.  Through my repeated test-fits, I learned that the internal corners of the Polysix have little wooden braces, which shorten the available space for my white plastic pieces.  Because of these braces, I'd put in the keybed and then I'd try to put in the Polysix's end-piece (with the bend wheel and mod wheel) and it wouldn't fit!  The braces and my plastic feet would interfere.  I had to repeatedly trim my plastic pieces (with the hack-saw) to accommodate the brace pieces to get it to fit.  Luckily, because I used screws and not epoxy, it is really easy to remove my plastic pieces from my keybed so that I could rework the pieces.

Once I got all the pieces to the correct length, I could do my final assembly -- keybed with the new booster pieces plus the controller plus all of the cabling between the controller and the keybed.  The picture below shows it fully assembled (though still upside-down, of course).  I'm not proud of what I did with the cabling.  You can see it there in the middle all covered with duct tape.  The problem is that I needed something to hold the cabling up against the keybed so that it wouldn't dangle down onto the synth's circuit boards.  When I did a test run of the synth while the cabling was dangling freely, the digital signals on the cabling radiated into the near-by audio circuits and introduced buzzing sounds.  It was  bad.  I had to get the cabling up off the circuit boards.  So, I used some duct tape.  The tape is clearly not a long-term solution, but it's the best that I could come up with on the spot.

Fully-Assembled Keybed with Booster Feet, Controller, and Duct-Taped Cabling
Another important detail with this assembly is that, when you flip over the assembly to insert it into the Polysix, the screw heads will now be on the bottom surface of the plastic and, therefore, will be between the plastic and the inside of the Polysix.  Won't it wobble?

After talking (again) with the friendly chap who helped me with the hand-held saw that I used to cut off the keybed feet, he showed me how to use his counter-sink drill bit.  With this funny-looking drill bit, you cut a space for the screw head to sink down and be flush with the rest of the surface.  That's exactly what I needed!  So, I pre-drilled the screw-hole like normal, then I used the counter-sink drill to make space for the screw head, and then I inserted and screwed in the screws until they were flush.  Now the bottom of the plastic piece is flat and smooth and sits nicely within the synth.  What fun!

My New Keybed with Booster Feet and Electronics Installed
So now the keybed is fully prepared.  I dropped it into the Polysix and she seems to fit pretty well (though there might be one or two really tall capacitors that are still giving me some interference).  The next steps are to plug it all together with the other electronics and to make her sing.  For right now, though, I'm satisfied that this mechanical assembly challenge is complete.  The mechanical stuff is a lot harder for me than the electrical stuff.

Thanks for reading!

Update: Tipping over a few capacitors so that the keybed sits properly

Sunday, March 17, 2013

Polysix - Keybed plus Arduino plus a Mess

Following this post, where I completed the cabling for connected the new Fatar keybed to the Keyparts UK controller, and following this post, where I replaced the Korg Polysix key assigner with an Arduino Mega, I'm now able to use the new keybed to play the Polysix.  It was pretty exciting for me when I got all the parts working together.  Check it lives!

If you choose to watch this video, it's important to notice the mess of wires that I've created.  In my opinion, creating a mess is an important component of any kind of hacking.  Whatever it is that you like to create, I bet that you create quite a mess when you're in the middle of it.  The messiness is a good thing.  It is a reflection of the rapid iteration of new ideas and of quick-thinking problem solving.  It's a necessary part of creation

So, if you're new to hacking, don't get yourself discouraged or don't let yourself feel overwhelmed if, in the middle of your project, you feel like you're doing something "wrong" if things get really messy.  It's OK.  The key is to create what you want to create.  Then, when you get the bits all working (like I did in the video above...yay!), that's the time when you can start tightening it all up.  That's when you can start thinking about making it pretty.  But feel no compulsion to do it sooner.  Embrace the mess!  Embrace the thrash of creation!

Update: Here's a demo once the system was buttoned-up for the first time.

Polysix - Cabling for the New Keybed

Continuing from this post where I began preparing my new Fatar keybed for installation in my Korg Polysix, I've now begun to prepare the cabling from the keybed to the keyscanning electronics.  I got both the keybed and the electronics from and they designed their electronics to utilize a cheap and widely-available cabling systems, which is cool.  The connection for the keyboard, for example, is setup so that one can use that big, wide, flat, ribbon cable that used in older computers to connect a hard drive to the mother board.  The picture below shows what I'm talking about.  What I need to do is modify the cable to connect between the Keyparts electronics and the Fatar keybed.

Raw Piece of Ribbon Cable That Will Be Modified for Use with my Fatar Keybed
One end of this cable (the one shown) can be used without modification to mate to the Keyparts electronics.  Fantastic.  The other end of this cable  needs to be modified.  I need to remove the existing connector (another one of the black things) and add the connectors that'll mate to to the sockets on the bottom of the Fatar keybed.  What do those Fatar connectors look like?  See below.  I'd never seen this kind of connector before.

The Orange Things Are the Connectors on the Bottom of the Fatar Keybed
Luckily, the folks at Keyparts UK have the mating connectors.  When they send you the connectors (two are needed for a 61-key keybed), they also include some guidance on how to put the connector onto the ribbon cable.  That's nice of them.  Unfortunately, their guidance assumes some basic knowledge about this style of connector and I lacked that knowledge.  For anyone experienced with putting connectors on this kind of ribbon cable, you wouldn't have had any problem.  For me, though, I'm only familiar with connectors where the wire must be stripped and soldered and that's clearly NOT how these work.

So, after talking with some of my electronics-knowledgeable co-workers, here's the key bit of information...there is NO stripping and NO just crimp it onto the ribbon cable!

For these Fatar-compatible connectors, here's what you do:

1) Cut the black connector off the 40-conductor ribbon cable
2) Split off a group of 16 wires from the ribbon cable
3) Stick the whole group of 16 into your connector (no stripping!)
4) Squeeze together the connector to crimp it onto your cable

That's it.  You're done.  How easy is that!?!

To flesh this out a bit, here are some know, for the I was a couple days ago...

First, cut off the black connector shown in the first picture above.  Second, split off a group of 16 wires from the 40-conductor flat cable.  Check out the picture below.  You can see that I've broken out one group of 16 wires (top) and already attached the orange connector.  Then, I broke out the second group of 16 wires (middle), which left a group of 8 wires with nothing to do there on the bottom.

Splitting Off Groups of Wires for Attaching the Connectors
Now for the third step...just stick the end of the ribbon cable into the connector (see below).

Just Stick the Unstripped Group of Wires into the Connector
Fourth, get some sort of flat-faced tool and press firmly to crimp the connector closed.  You do have to be a little careful here.  The trick is to find the right tool that'll apply a relatively even force across the width of these're trying to avoid bending or breaking the pins.  My approach was to use a couple of pieces of scrap aluminum to sandwich the connector and spread out the force.  Then, I used a small table-top arbor press (see picture below) to do the squeezing.  This worked like a champ, but is probably overkill.  If I didn't have the arbor press, I think that a set of pliers (plus think strips of plastic or metal to spread the force) would probably work fine, too.

Using an Arbor Press to Apply Even Force to Crimp My Connector

By applying the crimping force, the internal features of the connector bite through the wire's insulation to make the connection.  The internal features permanently deform during the process, which causes the connector to be firmly attached to the end of the flat cable (see below).  It's an absolutely brilliant system.   I can't believe that I'd never seen it before (yeah, I know, welcome to 1981, right?).

Finished Cable with Both Connectors Attached.
So, with the cable finished, it can be mated to the underside of the keybed.  I tested it out by connecting the other end to the Keyparts UK keyboard scanning electronics.  It works!  I can't believe how much easier this ways than stripping and soldering each of these wires.  Wow.  What a great system

The Modified Ribbon Cable Shown Attached to the Bottom of the 61-key Fatar  Keybed

Edit: Here's the next step...all the parts working together

Saturday, March 16, 2013

Polysix - Trimming the New Keybed

As I introduced in this post, I'm replacing the keybed in my Korg Polysix with a new keybed that'll have both aftertouch and velocity sensitivity.  The new keybed is a Fatar unit that I bought from Keyparts UK.  It plays as smooth as's really nice.  When the new keybed showed up on my door, I immediately unpacked it and stuck it into my Polysix to see if it fit.  It fits great...except for one critical detail...the Polysix's circuit boards are arranged so that they extend underneath the stock keybed.  As you can see below, the new keybed has more feet, and some of those feet want to stand right on top of the circuit boards.  Noooo!

The New Keybed Has Feet That Want to Stand on the Polysix PCBs
So, what is one to do?  Well, why just cut off the offending feet!

Looking at the build-quality of the keybed, it is built really strong.  It is quite stiff.  So, if some of the feet in the middle were to suddenly go missing, there's no concern (in my mind) that the keybed would sag.  No, it's too stiff for that.  And, the feet are simply plastic tubes, not metal.  It's almost as if the feet were designed to be easy to cut.

I wasn't quite sure what would be the best method of cutting the feet.  Would I just use a razor and my utility knife (aka box cutter)?  Would I use my hacksaw?  Dremel with cutting wheel?  After chatting with a very handy guy at work (who is asked to hack things to pieces all the time), he suggested that I use a small hand-held cutting tool that he had (see pic below).  It's got replaceable "blades", most of which are actually small fine-toothed saws.  That little saw looked perfect for the job.

Small Hand-Held Saw for Cutting the Plastic Feet
The hardest part of figuring out how to use the saw was figuring out how to hold the keybed so that it didn't slide all over the place.  Being a manually-operated saw, you do have to be a bit vigorous with your movements...movements that end up pushing and pulling the keybed all over the place.  So, as you see below, I leaned it against my leg and end the far end down at the floor between my feet.  Then, saw saw saw  on the keybed and, poof!, off pops the unwanted keybed foot.  Magic!

Sawing Off a Foot from My New Fatar Keybed
I ended up cutting off four of the middle feet from the backside of the keybed.  the Polysix PCBs don't reach all the way to the front, so no cuts of the front feet were necessary.  With the four middle rear feet removed, I was able to place the keybed in my Polysix without its feet standing on the the PCBs.

New Fatar Keybed Inside my Korg Polysix
You might think that I'm now done and could move forward with wiring the keybed to my new Arduino-based key assigner.  Unfortunately, that's not the case.  Now that I'm able to get the keybed into the Polysix without those pesky extra feet, I can now see that the keybed sits 3/8" too low compared to the stock keybed.  This is because the feet of the keybed (the ones that I didn't cut) are shorter than the feet on the Polysix's stock keybed.  This shortness is not just a problem of looking a bit funny.  No.  The shortness means that the entire back of the keybed is now resting on the Polysix's circuit boards.  That's not god.

Luckily, the shortness problem is easily solved by putting 3/8"-thick pieces of plastic under the keybed's remaining feet.  The plastic pieces boost the height of the keybed, which gets it up off the PCB.  Easy.  Pictures of that part of my installation will be the subject of a future post.

Thanks for visiting!

Edit: My next step...Cool Connectors for the Keybed Cabling
Edit: And after that...Boosting the Keybed

Tuesday, March 12, 2013

Polysix - Replacing the 8049 Key Assigner

I've finally resumed work on my earlier plan to replace the key assigner in my Korg Polysix.  My purpose is not actually related to the key assigner -- my purpose is actually related to adding aftertouch and velocity sensitivity to the Polysix.  In order to achieve these goals using my new Fatar 61-note keybed, I felt that the best course would be to replace the key assigner so that I had full knowledge and full control over all the signals.  To jump to the end of today's story, here's a picture of MIDI control of my Polysix using an Arduino!

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 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
So, after soldering all of the wires to my DISP socket, I pulled the Polysix's 8049 out of its socket and pushed my new socket into its place.  Pushing it into the socket was actually pretty difficult because my socket had round pins and the existing socket was expecting flat pins.  I was worried about breaking the socket or over-stressing the PCB.  So, I unscrewed the PCB and pushed some material underneath the PCB to give it plenty of support.  Eventually, I was able to push hard enough that it finally and decidedly dropped into place.

My Colorfully-Wired DIP Socket Inserted in Place of the Polysix 8049 Processor.
With the socket wired-up and finally in-place, I brought the wires back to the Arduino Mega.  I dropped the software onto the Mega and fired it all up.  There was no magic smoke released, so I was pleased.  Of course, it also couldn't do anything because I had no keybed attached yet.  So, I attached a Sparkfun MIDI Shield to the Arduino, which is the picture shown at the top of this post.  Using an external MIDI keyboard (along with MIDI parsing software routines that I wrote for the Arduino), I could now tell the Arduino what notes to play and, theoretically, the Arduino would command the Polysix to play them.

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.

Saturday, March 2, 2013

Polysix - Resonance-Controlled VCA

On the Korg Polysix Yahoo Group, there was a question posed about the purpose of the resonance-controlled "VCF" that was on the KLM-368 PCB.  After some consideration of the schematic and after reviewing the datasheet for the LM13600 IC, it's my opinion that this part of the circuit is a voltage controlled amplifier (VCA), not a voltage controlled filter (VCF).

My initial hypothesis was that this part of the circuit was used to decrease the amplitude of the audio signal when the resonance was increased.  My thinking was that, because the audio signal usually gets very large once the filter starts to self-resonate, this circuit was used to lower the volume and keep that self-resonating signal under control.  It turns out, though, that this hypothesis was totally wrong.  It turns out that this circuit increases the volume of the signal when the resonance is increased.  Let's look at the data to see why...

Measuring the voltage across R152 to see how the LM13600 is being controlled.
First, I wanted to see how the resonance knob affected the control signal to IC20 (an LM13600 OTA) that is at the heart of this resonance-controlled VCA.  The LM13600 is a current-controlled device, so I measured the voltage across R152, which is the last element before the control current goes into the LM13600.  From this voltage value, I can compute the current simply by dividing the voltage value by R152's resistance (10K).

Excerpt from the Polysix Schematic for the Resonance-Controlled VCA on KLM-368 Prior to the Effects Section.
My procedure was to dial in a particular resonance setting on the resonance knob and to manually record the voltage at R152 using my digital multi-meter (DMM).  I repeated the measurement for different settings on the resonance knob.  The results are summarized in the first few columns of the table below.  Note that for settings between 0-1, the control current is unchanged.  Then, by turning the resonance knob from 1-3, the control current changes rapidly.  Above a setting of 3 (all the way to 10...I checked), there is no change in the control to the LM13600.  This surprised me!

To dig a little deeper, I went back and recorded the audio signal going into this circuit and coming out of this circuit.  The easiest place to grab the input signal is from TP1 on KLM-366.  The easiest place to grab the output is TP4 on KLM-368.  My procedure was to set the resonance knob at the desired setting, to play a note on the keyboard (C1), and to record the audio with my M-Audio recorder.  I repeated the recording at several resonance settings.  I then brought the recordings to the PC and analyzed them in Cool Edit Pro V1.2, where you could immediately see what was happening...

Raw Audio Waveform Recorded With Difference Resonance Settings. 
As you can see, at TP1 (the input to this circuit) we see that the amplitude of the signal decreases as the resonance is increased.   This means that, if we were listening to the audio at TP1, it would get quite a bit quieter when we turned up the resonance.  Compare this to TP4.  At TP4, the amplitude barely changes in response to the resonance knob.  That's what this circuit must be must be compensating for this drop in volume.  With this resonance-controlled VCA, the user can twiddle with the resonance knob without experiencing a big drop in volume.  Cool!

I'm not satisfied, yet, though.  Let's further quantify things.  With these signals in Cool Edit Pro, I can use the "Analyze" feature to assess the RMS value of each of these blocks of audio.  This is one way to estimate how loud we would perceive each block of audio.  By comparing RMS values, you can guess how much louder or quieter each bit of audio would be.  These values are summarized in the middle columns of the table.  As could can see, at TP1, the volume would drop by about 10 dB when you turn up the resonance.  That's a lot!  By contrast, at TP4, the volume only drops by a couple of dB.  That's pretty good compensation!

Ideally, I'd be able to relate the amount of compensation (gain) back to the performance parameters of the LM13600 IC that is doing all of the work.  To try to understand how the LM13600 is working, I already computed the control currents, which should control the amount of gain of the LM13600.  Using my measured RMS values, can can compute the (relative) amount of gain actually produced by the LM13600 in response to the resonance knob.  As you can see in the last column of the table, the effect of the resonance knob is to increase the signal gain by 6 dB once you get to a knob setting of "3".  Is this what we should be getting?

Measured Control Current to IC20 at Difference Settings of the Resonance Knob.  Also shown is the Measured Gain from IC20 Relative to the Gain at a Resonance Setting of Zero.
Sadly, the analysis of the LM13600 proved too challenging for me.  The datasheet has a couple different equations for the gain of the LM13600, but these equations assume a certain configuration (or values) of the circuit elements around the LM13600.  The Polysix circuit doesn't quite match any of these examples.  I tried to use a PSpice model of the LM13600 (via WinSpice) without any luck...the results were garbage.  So, sadly, I cannot confirm if this is the way that it is supposed to work.  Given that we've already seen that the circuit seems to nicely compensate for the resonance-induced change in volume, I'd say that the circuit is working well.  If it's working well, it's probably working as intended.

So, what's the take-away from this?  First, that the designers of the Polysix appear to have added this circuit so that you can play with the resonance knob without also getting changes in volume.  That's great.  Second, in my own notions of by-passing the whole KLM-368 board (to eliminate the added noise of the effects unit and to avoid the changes in frequency response due all the other circuit elements), I will lose this nice functionality.  That gives me pause.

What do you see in this circuit?  Have I missed any other aspects of its behavior?