Saturday, July 20, 2013

Mono/Poly - Replacing a Trimmer Pot on KLM-398

Sadness strikes!  I went to turn on my Korg Mono/Poly the other day only to find that it was totally dead.  No sound and no LED lights.  The fact there were no lights was a pretty strong clue that it had no power.  So, opening up the Mono/Poly, I found that the fuses were blown.  When I replaced the fuse, I saw smoke pour out of one of the internal trimmer potentiometers.  Death spreads!  This post talks about the process of replacing a trimmer pot in a Mono/Poly.  Just so that you know that this has a happy ending, here are some clips of me playing my beloved Mono/Poly once I got it working again.

Replacing the Fuse:  The story starts with finding that the fuses were blown.  When I first opened my newly-dead synth, I probed around with my digital multi-meter to see if it had power.  I found that I had power on both sides of my transformer.  On the power supply PCB, however, I did not have voltage downstream of the two fuses that separate the transformer from the diodes and power caps.  So, I pulled the two fuses and visually saw that they were indeed blown.  So, I went to Digikey and found some fuses rated for 1.6A as stated on the schematic (Digikey P/N: 486-1882-ND).  When they arrived, I found that they were not transparent as suggested by the Digikey product page, but were opaque as shown in the picture below.  Oh, well.

Old (dead) fuse on the left.  My replacement fuse is on the right.
Burning a Potentiometer:  When I put the new fuse into the synth and turned it on, it only took a couple of seconds until I saw smoke issuing from one of the trimmer pots on KLM-398.  Smoke is never a good thing when working with electronics.  Usually, if you let out the magic smoke, it stops working.  So, I quickly turned off the synth, removed KLM-398, and took a close look.  The smoke came from VR2 (see photo below).  Very close inspection (2nd photo below) does indeed show charring (carbon) on the pot.  It needs to be replaced.

VR2 let out the magic smoke.  It is probably dead.

Close Inspection Reveals Some Charring (Black Carbon)
Removing the Dead Pot:  To install a new pot, you must first remove the dead pot.  That's a simple process of de-soldering the pot, pulling it from the board, and cleaning out the solder holes of any residual solder.  The pictures below show how I needed to use a pliers plus my soldering iron to remove the pot.  Once it was off the PCB, you could see a small burn mark on the PCB confirming that I removed the correct one.  To remove the residual solder, I chose to use a solder pump (see this post for more discussion of solder wick and solder pumps).  With the solder holes clean, I'm ready to install the new trimmer pot.

Removing VR2 by applying heat to the solder while pulling on the body of VR2 with pliers.
After removing VR2.  you can see burn marks on the PCB.
After removing VR2, you have to clear the holes of solder.  I use a spring-loaded solder pump.
Holes for VR2 after removing the solder.
Buying a Replacement Pot:  Of course, to install the pot, you must first buy the pot.  The schematic calls out a 100 kOhm pot, but gives little other information.  Digikey has tons of options for 100K pots, so I wasn't quite sure what to get.  Looking at the PCB, I clearly needed a pot with 3 legs in a triangular configuration.  Also, given that I smoked the original pot, I wanted a new pot that had more than the absolute minimum power rating.  I found a bunch that seemed reasonable and bought a few different models.  In the end, I decided to use the pot shown in the pictures below.  It is Digikey P/N 3362F-1-104LF-ND.  The only undesirable aspect of this pot is that the legs are not wide enough.  You need to use pliers to bend them outward, as shown in the right-hand picture below.  When you do that, the legs are now barely long enough to poke through the holes in the PCB.  Since they're so short, you have to be careful when soldering that you are able to heat the legs before applying the solder.

Replacement 100 kOhm trimer potentiometer.  The pot is small, so you have to bend the outward.
Soldering the Pot:  After bending the legs and inserting the pot's legs in the holes in the PCB, you are ready to solder it into place.  The soldering process is pretty straight-forward, as long as you can actually tough the pot's legs with the soldering iron.  If so, apply the heat, apply the solder, and you're done!  Since the new pot is not the same as the original pots, it does look a little funny on the PCB (see picture below), but that's OK with me as long as it works!

Soldering the new potentiometer onto the KLM-398 PCB.
Re-installing the PCB and Tuning:  With the PCB complete, simply screw it back into its spot inside the Mono/Poly and reconnect the wiring harness (see photo below).  Now it is time to cross your fingers and turn on the synth.  I got lucky -- there was no more smoke.  It seemed to run OK!

Mounting KLM-398 back into my Mono/Poly
Re-Calibrating the Mono/Poly:  Now that it's powered, I can go through the calibration procedure in the Mono/Poly Service Manual so that I can tweak the new pot so that it is properly doing its job.  I chose to start from the beginning of the Service Manual's calibration procedure, which begins with checking the power supply voltages (always start by checking these voltages!).  I then checked and corrected the voltages on the Key Assigner PCB.  After that, you reach the part of the procedure where you check the voltages produced by the KLM-398 PCB.  In my version of the manual, it says to check the voltage on the red, yellow, blue, and gray wires.  I disagree.  In my opinion, they are wrong about the Red should be the black wire.  Note that the pots are in a funny order on KLM-398.  I just replaced VR2, which is not associated with VCO2 (gray wire), but is instead associated with VCO1 (black wire).  Once I got all of that straightened out, I used my digital multi-meter set on mV mode and adjusted my new VR2 until the black wire showed 0.000 V +/- 1 mV (see picture below).

Adjusting the new pot to achieve the desired voltage on VCO1.
Playing the Synth:  After confirming the voltages produced by KLM-398 for all four VCOs, I closed up the synth, plugged into my amp, and started playing.  It works!  Oh the joy!

It's good to have the old girl back working again.

Polysix - Adding Single-Trigger Mode

Returning to my long string of modifications (most recently adding a sustain pedal), I'd like to talk about a new trigger mode that I added to my Korg Polysix.  As you likely know, the Polysix can be played as a 6-voice polyphonic synth or, using the "Unison" or "Chord Memory" buttons, can be played as a monophonic synth.  For basses and leads, monophone mode is often more fun for me.  The problem for me comes with how the Polysix retriggers its envelopes.  Whether you're playing legato (notes are connected) or staccato (space between the notes), the Polysix always re-triggers its note envelope with each key press.  This behavior is called "multiple trigger" mode and it really interferes with making swooping/soaring legato lines.  Instead, I'd like the option of "single trigger" mode, which prevents the envelopes from re-triggering until all keys have been released.  Because the envelope triggering is handled by the Key Assigner, and because I've replaced the Key Assigner with an Arduino, it means I can do my triggering however I'd like.  So, I added a "single trigger" mode in addition to the default "multiple trigger" mode.  Here's a demo.

Triggering an Envelope with a Single Note:  The Polysix, and most other synthesizers, have their filter (VCF) or their volume (VCA) controllable by an envelope.  Usually, it's an an envelope with four parameters that can be controlled -- attack, decay, sustain, and release -- which is why they are called ADSR envelope.  The envelope starts (is "triggered") whenever you press a key (as shown in the figure below).  It runs through the attack and decay phases and sits in the sustain phase until the key is released.  Then it completes the release phase and is done.  In a polyphonic synth like the Polysix (when in "Poly" mode), each voice has its own envelope, so whenever a key is pressed, a voice is allocated, and its envelope is triggered.  That that key is released, that voice enters its release phase and is done.  Easy.

Triggering with Multiple Notes:  For monophonic synthesizers (and for the Polysix when in "Unison" or "Chord Memory" modes), the synth has to decide what to do if the player has two keys depressed.  This happens all the time during single-note runs when the player might press the next key before he has had time to release the previous key.  Many synths behave like the stock Polysix does, which is each new keypress retriggers the envelope.  This is shown in the figure below where the 2nd key press (which preceeds the first key release) causes the trigger to re-start its attack phase.   This is called "multiple trigger" mode because multiple notes cause multiple triggers.  Notice that the first key release has absolutely no effect.  It's only the last key release that finally initiates the release phase.  In the early days of synths, this "multiple trigger" behavior was one of the most famous differences between old Arp synths (which are "multiple trigger") and old Moog synths (which were "single trigger").  The benefit of the "multiple trigger" mode is that it makes a run of fast notes sound very articulate and punchy because the envelopes adds dynamics to every note, regardless of whether you're articulate and playing staccato or you're a bit sloppy and playing legato.  As a result, players across a range of skill levels (or sobriety levels) really sound like they're shredding when using "multiple trigger" mode.

"Single Trigger" Mode:  The alternative to "multiple trigger" mode is "single trigger" mode.  Here, only the first key press causes the envelope to trigger.  The envelope will not be retriggered until all notes have been released.  As a result, multiple notes will only cause that single trigger event (hence the name).  This is shown in the figure below.  The benefit of this mode is that the attack and decay can be set to long values so that a filter sweeps in a slow soaring fashion while the players musical phrase plays underneath.  It can be a very nice effect.  If the player wants to retrigger with every note, he must use his skill to be sure to release his key before pressing the next one.  So, with multiple triggers, good keyboard skills allows you to have it both ways.

Implementing on the Polysix:  To be clear, I do not have good keyboard playing skills.  But, I do like to occasionally play those kind of soaring "single trigger" kind of synth lines.  So, I modified the software on my Arduino Key Assigner to let me toggle between the two modes.  When I press either the "Unison" or "Chord Memory" buttons, my Polysix defaults to "Multiple Trigger" mode, like normal.  If I press the button again, however, the LED dims and I know that I've switched to "Single Trigger" mode.  If I want to switch back to "Multiple Trigger", I simply press the button again and the LED brightens to indicate the return to normal operation.  As you can see in the video at the top, I enjoy having this flexibility.

Are there any other triggering modes out there that I should consider?

Update: I shared my Arduino code here

Thursday, July 18, 2013

Polysix - Removing Korg's Treble Boost

Following from this post, which discussed mods to bypass or remove the post-effects VCF, some folks listening to by demos have commented that the modified sound is perhaps too bright or too raspy.  That's a fair criticism.  Because we've removed the post-effects VCF, perhaps it's also time to consider removing circuit modifications introduced by Korg itself into the Polysix design to try to boost the high-frequencies that had been lost in that filter.  If we eliminate the "illness" (ie, the overly-mellow sound caused by the post-effects VCF), maybe we should eliminate the "cure", too.  That might remove the excess raspiness.

First, let's start with the quote from the Service Manual (see item 4):

Excerpt from Last Page of Polysix Service Manual

Intrigued by item (4), I went to the schematic and found that all of these components are around the last VCA at the end of the KLM-368 "Effects" PCB.  An excerpt of the schematic is below.

Looking at this circuit, what immediately caught my eye were the elements that I circled in red.  Normally, an LM13600-based VCA would be fed the input signal via a simple resistor like the R168 (22K).  Note that Korg has added a parallel path through the C76 cap followed by the pair of resistors.  What this allows is for high-frequencies (which will pass through the cap) to go around the relatively large 22K resistor and get to the LM13600 VCA via 1K resistor.  This boosts the treble.  And given how small that C76 cap is, it's going to boost only the highest of frequencies (the raspy ones).

Opening up 5Spice Analysis, I modeled this little bit of the circuit to estimate the corner frequency and to see what would happen if we modified this part of the circuit to try to eliminate the raspiness.  First, I modeled the circuit as drawn.  Then, I modeled the circuit as if I removed the 1K resistor that is in parallel with the 33K resistor.  Here's what I found:

Modeled Response of the Treble Boosting Elements on KLM-398

The red line is the circuit as it appears in the schematic.  Above 3.5 kHz, the treble response just goes higher and higher.  The black line is when I remove the upper 1K resistor.  Because the capacitor is still in the circuit (because of the 33K resistor), there is still 3 dB of boost to the treble.  But, the boost to the highest, raspiest frequencies is eliminated.  At 10 kHz, for example, removing that 1K resistor drops the response by 6 dB.  That could be just the thing to take the raspy edge off the sound.

Because I happen to like the very bright sound of my Polysix, I did not snip out the 1K resistor to try to tame these frequencies.  Therefore, I have no audio comparison to demonstrate the effect.  Sorry.  If you try this mod, be sure to let me know how it goes!

Saturday, July 13, 2013

Polysix - Bypassing the Post-Effects VCF

In a previous post, I discussed how the Korg Polysix has an amplitude-driven VCF that is located just after the synth's effects section.  I discussed how it fails to open all the way, which attenuates the sizzling high-frequencies produced by the synth and makes it sound muffled.  The VCF is also slow to respond to changes in amplitude, which softens the synth's attack.  At the end of that post, I mentioned a mod to defeat this VCF, which restores its sizzling response and fast attack.  This post adds more detail on the removal of this VCF.  To start with the good stuff, here's a very simple soundcloud demo:

Overall Circuit:  To get started, let's look at the schematic for this part of the Polysix.  All of the elements that I'm going to discuss are on the KLM-368 "Effects" PCB.  Below is an excerpt of this schematic with the different blocks labeled.  The most relevant blocks are the VCF circuit itself (based on an LM13600) marked in yellow.  What drives the cutoff frequency of the VCF is an envelope detector circuit marked in blue.  These two circuits work together to determine how much high frequency sound gets through the synth.

A picture of this part of the synth is shown in the photograph below.  The LM13600 at the heart of the VCF (ie, U15) is shown in the socket at the center of the photo.  This will be the area for our modifications.

Picture of the Unmodified Circuit Around the Post-Effects VCF.
Defeating the VCF:  The first modification is the mod that I discussed very briefly at the end of my post linked above.  I said that you could defeat the VCF by forcing it to be fully open all the time.  You can do this by applying +15V to Q14.  Q14 controls the current flowing through the filter, which controls the filter's cutoff.  By applying +15V, you force the filter open as far as it will go.  As shown in the schematic below, I do this mod non-destructively by using a clip lead to grab +15V from R125 and apply it to Q14 by clipping to R89.  If you do this, make sure you get the correct side of R125 and R89.  As shown in the picture below the schematic, you need to clip onto the bottom of R125 and of R89.

By Jumping from R125 to R89, +15V is Applied to Q14, which Forces the VCF Open.
Using a Clip-Lead to Defeat the Post-Effects VCF by Forcing it Open.
The Sound of Defeating the VCF:  After adding this one clip lead, how does it sound compared to the stock Polysix?  Well, in that soundcloud demo at the top, you clearly hear that muffled sound of the stock Polysix is removed and that the sizzling high-frequencies come through.  To my ears, it's fantastic.  If you like the more mellow sound of the stock Polysix, simply remove the clip lead.  No harm was done!

Permanently Removing the VCF:  On the Polysix Yahoo Groups, there was a post by Tony of Oakley Sound who suggested that the best course would be to simply remove the VCF entirely.  This would remove any noise contribution of the VCF and of its associated envelope follower.  This is a fantastic idea.  In his post, he discussed how to do the mod.  Because it involved soldering and de-soldering components, it can make people nervous.  So, instead, I propose a non-destructive version of his mod.  

Non-Destructive Removal of the VCF:  As you can see in the photogrpahs so far, U15 (the LM13600) is socketed.  This means that you can simply pop it out of the circuit without hurting anything (though do turn off the synth first).  Removing U15 removes the VCF from the synth.  Easy, eh?

Pop U15 (an LM13600) from its Socket, and You've Removed the VCF!
Reconnecting the Signal Path:  Unfortunately, removing U15 also breaks the audio signal path, which means that you'll get no sound.  That's not so nice.  To fix this problem, Tony says you'll need to find J28 and J29, which are jumpers (ie, zero ohm resistors) that are not on the paper schematic.  Once I found out where they were, I added them to my schematics, including the excerpts shown here.  As you can see, they bring the dry audio signal (J28) and the effected audio signal (J29) to the VCF (U15).  So, to reconnect the audio path, you can use a clip lead to connect J28 and J29 and then use a second clip lead to jump from either J28 or J29 (remember, they're now connected) all the way over to R168.  As you can see in the schematic below, this jump to R168 brings the dry and effected audio down to the final VCA, which is also the overall output point from this PCB.  As you can see in my picture below the schematic, be sure to connect to the left side of R168 (though it doesn't matter which side of J28 and J29 you clip to).
To Non-Destructively Remove the VCF, Pop out U15 from its Socket, Clip J28 to J29, and Clip J28 to R168.
The Empty Socket was U15.  The Clip Lead Jumps J28 to R168.  I still need to Jump J28 to J29.
The Sound of the Removed VCF:  After removing the VCF in this way, how does this sound?  Well, in the simple demo at the top, it sounds much like my first mod -- it greatly increases high-frequency sizzling sound of the synth.  At first listen, removing the VCF doesn't really sound different from simply defeating the VCF.  But, I have yet to play the synth at any length now that I've removed the VCF, so perhaps this mod will show its differences under other types of playing.  I do like the idea of completely removing the VCF from the circuit.  So I think that I'll keep this version of the mod, for now.

Improved Attack Time:  Besides increasing the high-frequency sizzle of the synth, defeating/removing this post-effects VCF also improves the synth's attack time.  Sometimes the Polysix is criticized as having slow envelopes because the start of the notes can sound a bit soft.  Since the per-voice envelopes are very snappy (~1 ms attack time), a little investigation shows that the problem is the slow response of the post-effects VCF.  The graphs below show the start of a high-pitched note output by the Polysix when in its stock configuration (top graph), with the VCF defeated via +15V at Q14 (middle graph) and with the VCF removed via removal of U15 (bottom graph).  Along the bottom is the time in seconds.

Attack of a High-Pitched Note.  (Top) Stock Polysix.  (Middle) Defeated Post-Effects VCF.  (Bottom) Removed Post-Effects VCF. 
As you can see in the top graph, the stock Polysix can take about 10 ms for the sawtooth amplitude to reach maximum (though it does get within 3 dB within of 3 ms).  By contrast, defeating VCF (middle graph) or removing the VCF (bottom graph) allows the sawtooth to reach its maximum in less than 1 ms.  The snappy sound is back!  Furthermore, look at how sharp-edged the sawtooth is in the bottom two graphs versus how rounded it is in the top graph.  This is a visual illustration of how the VCF is muffling the very high frequencies of the Polysix.

Effect on Noise:  The assumed purpose of the post-effects VCF is to attenuate the noise generated by the Polysix effects circuits.  They are hissy.  By defeating the post-effects VCF, we are allowing all that noise to pass.  By removing the VCF, we might all the noise to pass, but we might eliminate the noise of the VCF itself.  To see if this was the case, I did some measurements of the noise produced by my Polysix.  The noise spectra are plotted below.  (Notice the logarithmic spacing on the frequency axis.  Sorry, but it's the only decent way to show such a wide range of frequencies.)

First, let's ignore all the spikes in these graphs.  Most seem to be due to line noise (60Hz) and its harmonics.  Different configurations look different at the different spikes, but none of them is clearly superior.  So, instead, let's ignore the spikes look more broadly.  What I see is that the stock Polysix (blue) has the worst noise of the three configurations for the frequencies from 100 Hz out to about 1000 Hz.  Defeating or removing the post-effects VCF seems to lower the noise level in these frequencies.  That's great!

Above about 2000 Hz, though, we see that the green line is the worst.  The green line is the case where I defeat the VCF by forcing it to be open all the time.  This condition is about 2-3 dB noisier than the other two cases.  Because this vintage synth only has a signal-to-noise ratio of ~45 dB to start with, loosing another 2-3 dB is definitely noticeable.

Conclusion:  Overall, I'd say that the red line is the best.  This is the case where the post-effects VCF is removed by pulling U15 and jumpering J28/J29 over to R168.  It shows the lowest noise in all frequency bands, with the exception of the spike at 120 Hz.  If you can live with that, you get decently low noise everywhere else, you get the full high-frequency sizzling sound available from the Polysix, and you get the fastest attack for each of your notes.  It's a winner.  And, it's fully-reversible if you decide you don't like it!

Update: Is this modification now too bright?  Try removing Korg's own attempt to brighten the synth!
Update: Want to make the mod more robust?  Try soldering a jumper wire instead of using the clip lead!

Friday, July 12, 2013

Polysix - Temperature without Mods

In this previous post, I measured the temperature of my Korg Polysix because I was worried that my modifications were drawing too much power and possibly over-taxing the power supply.  Without a similar measurement on an unmodified Polysix, I couldn't know whether the value that I measured was normal or abnormal.  Well, I decided that I could approximate an unmodified Polysix by disconnecting my mods and repeating my test.  Here are the results (F on top, C on bottom):

To define my test a little more specifically, I measured the temperature of the metal bar acting as a thermal bus for the linear regulators in the power supply.  I measured the temperature mid-way between the 3rd and 4th regulators (see picture below), which was the hottest spot for my modified Polysix.  I did the test on two sequential days with the initial temperature being 75.7 F for the test of the modified synth and 74.4 F for the de-modified synth.

For the "modified" synth, the relevant changes are: (1) the removal of the Polysix's 8049 microprocessor that had been the key assigner, (2) the addition of a key scanning microprocessor from Keyparts UK (measured as 55.3 mA from 5V), and (3) the addition of an Arduino Mega to do all the key assigner functions (measured as 58.3 mA from 5V).  When testing in the "de-modified" condition, I disconnected the key scanner and the Arduino.  I could not, however, put the 8049 back into the synth.  Therefore, the "de-modified" condition under-represents the temperature of a stock Polysix.

Looking at the graphs of the temperature versus time shown at the top of this post, you can see that the test of the modified Polysix reached a final temperature around 148F (63C) whereas the test of the de-modified Polysix reach a final temperature of only 136F (58C).  Clearly the 570 mW of the key scanner and Arduino have an impact.  That's good to know.  Also, this data tells us that the final temperature of the synth varies as 17.7 F per Watt.  That'll be a useful number in a moment.

Now, to estimate the temperature of a stock Polysix, I can take the temperature from the "de-modified" test and add in the additional heating due to the power draw of the 8049 microprocessor.  Based on the 8049 datasheet, it says that it draws 30-70 mA from 5V (ie, 0.15 to 0.35 Watts).  With this added power draw, I estimate that the final temperature will be (136F + [0.15 to 0.35 Watt]*(17.7 F/Watt)) = 138 to 142 F.  Let's pick the middle value and call it 140F (60C).

OK, now I can finally answer the question as to whether my mods are putting my power supply at risk.  My modified Polysix reaches 148F.  Compare this to my estimate of the temperature of a stock Polysix, which is about 140F.  That's a reasonably big difference in temperature.  While maybe this difference is OK, I should probably not add any more components that would further increase the power draw.

For example, I have this idea of adding wavetable oscillators to the Polysix.  If I do this using six discrete Femtoduino microcontrollers, this would probably require ~120 mA from 5V, which would be 600 mW.  Adding this to my already-modified synth would result in a final temperature around 156 F (69C).  Now, if I were to play this synth in a hot room (85F) instead of at cool conditions of my test (75F), that would mean that my power supply would be running at 156F + (85F - 75F) = 166 F (74 C).  That's got to be too hot.  My conclusion is that, if I want to add these components, it looks like I'll have to add my own power supply.

Tuesday, July 9, 2013

Polysix - Adding a Sustain Pedal

A stock Korg Polysix does not allow for a sustain pedal.  The Polysix does have a jack to set the Chord Memory using a pedal (which is a bit esoteric) but not for sustain.  Why?   In my opinion, this should be a basic feature of any polyphonic synthesizer.  Well, ever since I replaced my Polysix's "Key Assigner" with an Arduino, I've been looking forward to adding a sustain pedal to my Polysix.  This post describes how I did it.  Here's a video demoing my mellow enjoyment of it...

Previous Approaches:  Looking around the web, there are a couple of approaches that people have taken to adding a sustain pedal to the Polysix.  On the Polysix Yahoo Groups archive, this thread has some replies that talk about adding some electronic components that, in effect, use a foot pedal to be a remote-control for the Polysix's "Hold" button.  While that is OK, turning off the "Hold" button (on a stock Polysix) turns off all notes, including those that are still being held by the player's fingers.  This is not what I want.  The only way that people seem to have had success is with the various MIDI retrofit kits (eg. from Kiwitechnics, from Johannes, or from CHD).  Nearly all of them replace the Polysix's Key Assigner with their own microprocessor and software, which allows them to add the sustain pedal functionality.  Since I, too, replaced my Key Assigner, then I, too, can add the sustain pedal functionality.

My Plan:  My plan is to take a similar approach as all the MIDI retrofit kits.  I'm going to re-use one of the jacks on the back of the Polysix, I'm going to wire it back to my Arduino (my replacement for the Key Assigner), and I'll write some software for the Arduino that will implement the sustain pedal functionality.  Now, when I add the sustain pedal, the configuration of my modified Polysix will look like this:

Choosing the Jack: For my sustain pedal, I chose to use the "From Tape" jack on the back of the Polysix.  I do not plan on using the Tape functionality anymore, so I'm now re-using one of its jacks.  Future mods (e.g. Portamento pedal) will utilize the other jacks.

Re-wiring the Jack:  Inside the Polysix, I disconnected the white wire that had been connecting the jack to the small High/Low switch.  You can see in the pitcure below that I labeled the white wire (in case I want to reconnect it in the future) and soldered in a red wire in its place.  In this picture, the wire that I added is the red one going down -- not the one going up and to the right.

Connecting to the Arduino:  Stringing the red wire along the bottom of the back panel of the synth, I pass by the power supply and reach the Arduino Mega mounted on the other side.  The Arduino is already wired up with tons of wires connecting it to various parts of the synth (most of them going to the jack for the old 8049 Key Assigner).  I added the single wire from the Sustain Pedal jack to the mess of wires shown below.  It's connected to one of the digital pins.  With this mess, though, even I can't tell which one it is.  You'll just have to trust's connected there somewhere.

Configuring the Arduino:  To configure the Arduino to read the foot pedal, you have to understand how the pedal works.  My foot pedal is a normally-open switch.  This means that, normally, no current will flow through the food pedal.  When you press the pedal, the switch closes, which will allow current (if a voltage is imposed by the Arduino) to flow through the pedal.  This is how the Arduino will sense whether the pedal is closed or not.  In the Arduino software, I tell the Arduino that the given digital pin is an input (via "pinMode") and  tell it to impose a voltage on this pin via its pull-up resistor (using "digitalWrite").

Reading the Pedal State:  The software to read the state of the pedal is simply "digitalRead".  If the pedal is not pressed, no current will flow, so the pull-up resistor is able to maintain 5V at the Arduino's pin.  Therefore "digitalRead" returns HIGH.  When the pedal is pressed, it allows current to flow from the pin to ground.  That current has to pass through the pull-up resistor, which means the voltage at the pin as seen by the Arduino is very low.  As result, the "digitalRead" will return LOW.  So, whenever "digitalRead" says LOW, the pedal is pressed and the Polysix should sustain all its notes.  Whenever "digitalRead" says HIGH, the pedal is not pressed and the notes should decay normally.  Easy.

Writing the Software to Sustain the Notes:  While reading the state of the pedal is easy, writing the software to implement the sustain and release logic was surprisingly challenging.  The "voice stealing" algorithms that allow a six voice synth to gracefully handle more than six MIDI notes get more complicated if some of the notes are being sustained.  If you're looking to implement your own Key Assigner and looking to add a sustain pedal, expect to spend a little time trying to think clearly about how you're going to implement it.

Success:  Luckily, a little good old fashioned trial-and-error combined with a whole bunch of "Serial.println" commands afforded me an inefficient, but ultimately effective, path to success.  The video at the top is a demonstration of its functionality.  Normally, I like to play at fast tempos.  The sustain pedal motivates me to slow down and relax.  I like it.

Thanks for reading!

Update: I shared my Arduino code here

Sunday, July 7, 2013

Polysix -- Taking its Temperature

After my long string of modifications to my Korg Polysix, I've now got several additional electronic components drawing power from the Polysix's built-in power supply.  I've been worried that I might be taxing the power supply too much.  Feeding this fear is that, when I touch the back of the Polysix, it seems awfully hot.  Since I don't have an unmodified Polysix to compare to, all I can do is take some measurements and see if anyone out there on the Internet can confirm if my readings are normal, or if they're too hot.  Does my Polysix have a fever?

To measure its temperature, I'm using the thermocouple that came with my digital multimeter.  It's a hot day here in the Northeastern United States, so as you can see below, the ambient temperature is 86.4 F (30 C).

After playing my modified Polysix for about 30 minutes, the picture below shows that the back surface of the Polysix is reading almost 109 F (43 C).  It is quite warm to the touch.

Opening up the Polysix, I measured the temperature of the metal bar that is acting as a heat sink for four of the voltage regulators.  Poking around a bit, I find that the hottest spot is between the third and fourth regulator.  It is reading 138.4 F (59 C).  That's getting  pretty hot!  I also measured the temperature of plastic casing of each of the four regulators, and they were all lower than the temperature of the metal bar (which was a bit surprising).

While I had the synth opened up, I also measured the temperature of the transformer.  it was reading 123.5 F (51 C).  While that's really warm, it could certainly be worse.

So, my question for all of you is whether you think that 140 F (60 C) is too hot for the power supply.  Am I over-taxing the power supply?  What is the temperature shown by an unmodified Polysix?

To be truthful, I'm actually interested in drawing even more power from the built-in power supply.  My mind is currently dreaming of 6 Arduino Micros (or 6 Femtoduinos) to add a second oscillator to each voice*.  I'd like to use the built-in power supply to power these additional units.  If my existing modifications are already causing this much additional heating, I'm thinking that it would be unsafe for me to draw even more power.  Thoughts?

(* Yes, I could use a single microcontroller to create all six new voices, but I want to do the six voices as wavetable oscillators where the sample rate changes to effect the desired pitch.  Since the sample rate will be driven by an internal timer interrupt, and since I don't want the 6 different timers conflicting with each other, I think that I need 6 separate microcontrollers.  That's a lot of additional power draw.)

Update: Here I compare the temperature to my de-modified Polysix.