Monday, October 21, 2013

Rockin the LED Party Hat

Inspired by Adafruit's Electronic Halloween, and in particular Becky Sterns "Space Face" and "Firewalker LED Sneakers", I decided that I had to make something light up this Halloween (and maybe wear some make-up, too).  Here's what I came up with:

While the video above simply has the LEDs oozing through the rainbow colors (straight out of Adafruit's example code for the LED strip), my hat was also equipped with a bunch of sensors to allow it to respond to the world around it.  Check out the two other operating modes below:

So, you can count me as one of the multitudes of folks adding LEDs to hats for good fun at parties!  It may be simple, but it's SO MUCH FUN!

Interested in making your own world-responding LED hat?  Well, below are a couple pictures showing some details on how I put it together.

And my shopping list was:
The most expensive thing on my list is the Mongoose.  I happened to have one that I harvested from an old project.  It's nice and small and has all those cool sensors...but it's pricey.  If you don't want to spend the money for that, you could use a regular Arduino.  That will let you do pre-programmed LED effects (like the rainbow effect shown in the first video).  And that would be totally cool just by itself.  If you do want to add the ability to be sensitive to motion (like I did), you can still avoid the Mongoose by using a regular Arduino paired with one of those accelerometer / magnetometer combo sensors.  You could try this one from Adafruit.  I think that would work just fine.

One of the hardest parts for me was figuring out how to attach it all to the hat.  So, on my wife's very good suggestion, I used a little twine to tie the battery pack through the holes in the wicker hat and loops of thread to "sew" the LED strip to the hat at select locations.  Easy!  And, it was surprisingly effective.  (Maybe that's because my wife also helped greatly in actually doing the attaching!)

So, that's my story.  It was a great hat.  It was also (for me) a fun make up job.  Another set of thanks go to my talented make-up artist, Ange!

Sunday, September 15, 2013

First PCB - Board Has Arrived

As a follow-up to this post, my first PCB has arrived from the printer!  She's a beauty (to my eyes, at least)...and so tiny!

I used my multi-meter to ensure that all the connections go where they are supposed to go, and to confirm that the connections do not go where they are not supposed to go.  It looks like it's time to solder in the components and give it a go!

(Note, this'll also be my first time soldering surface-mount components...I designed the board with one SMT cap on the front and one SMT cap on the, just to give me a reason to give SMT soldering a try.  I'm hopeful!)

Follow-Up: I finally assembled the PCB. Check it out here!

Saturday, September 7, 2013

Rockin' the Casio

Sometimes, when you're away from home but still need the feel of some synth keys under your fingers, you just gotta go with whatever available locally.

The Classic Casio SA-76.
So I'm attending a conference in Boston.  I'm staying at a friend's house.  I didn't bring any of my synths (I mean, really, traveling to a non-music conference with one's synth would be a little silly).  The chaos of the traveling and of the schmoozing and meetings has made me uptight.  I need to chill-out, I need to relax.  But I got nothing with keys, no musical instruments of any kind.  What to do?

Well, being a Renaissance Man (and his lady being a Renaissance Lady), my friends are raising their very young children delightfully, with full engagement with language and nature and arts and music.   So, while their young ones might still be a bit small for a proper Moog, they are not too small for the timeless power of an all-in-one Casio.  As can been seen, their particular Casio SA-76 is clearly Hello Kitty approved.

Looking at this synth, you might not be impressed.  Sure, the keys on this smokin' axe might be miniature, but my joy in having something -- anything -- to calm my traveler's nerves was anything but miniature.  Each one of its 26 little ivories and 18 little ebonies was a tender salve to my travel pains.

The Key to Casio Appeal...the Backing Beats.
We all know that the draw of a classic Casio is the depth of its pre-programmed beats.  And I was not disappointed.  Oh, "POPS", who knew that if you dropped the Casio's Tempo down to "4", your kicks would thump and your hi-hats would snap in such Hip-Hop-Horray that my stresses would be forgotten.

Then, by incrementing the pattern (#5, yes #5!), speeding the beat a bit, dialing in a tasty organ, who knew that the Casio would become a magical teleportation device delivering me to my musical happy place. And who knew that, on that day at least, my musical happy place would be Rockin' the Casio!

Tuesday, September 3, 2013

First PCB - MCP4922 DAC

I've done it.  I've made the leap.  I've designed my first PCB.  Yay!

Top and Bottom Illustrations of my PCB (from OSH Park)
The purpose of my new PCB is to be a breakout board for the MCP4922 DAC.  This is a 2-channel, 12-bit DAC that I've used for previous projects including: (1) a pitch CV quantizer for my theremin, (2) a pitch CV corrector for my ribbon controller, (3) a CV recorder/looper for my Korg Mono/Poly, and (4) an Arduino wavetable oscillator.  It's this latter project -- the wavetable oscillator -- that I'm looking to resurrect.

I'm eventually looking to make six of these wavetable oscillators -- one for each voice of my Korg Polysix.  On my previous projects, I just wired up each DAC individually by hand on some proto-board.  But, when making six, that's just too full of error possibilities.  So, I designed my first PCB to simplify the construction of six units.  This simple first board will be a stepping stone to my actual goal, which is to build a bigger board that includes two of these DACs (permitting 4 channels of audio and/or CV outputs) along with an Arduino-compatible AVR microcontroller to drive the DACs.  All of this will be on one PCB.  For a guy who has never designed a PCB before, I figured that it would be better to start smaller...such as with this MCP4922 breakout board.

Schematic that I Created in Eagle 6.5
For software to do the PCB design, I chose to use CadSoft Eagle.  I hear that Design Spark might be a better choice (also free, but with fewer constraints than Eagle), but most of the bigger DIY electronics sites (Sparkfun, Adafruit) seem to provide their designs and models in Eagle, so I went with that.

Any PCB design starts with defining the schematic for the circuit that you want to turn into a PCB.  Since I'm just doing a breakout board, the schematic ought to be very simple since their are so few components.  The primary elements are just the IC in the middle and some connectors (or through-hole solder points) around the periphery.  As you can see in the schematic above, I all the input signals to the DAC come in via an 8-pin header on the bottom left (I only needed 7 pins, but the PCB model for the 8-pin looked better).  As for the outputs of the DAC, I brought its two outputs to separate 2-pin headers, as shown on the right side of the schematic.   Pretty straight-forward.

In addition to the connectors around the periphery, it is common for a breakout board to include those supporting components (capacitors and resistors) that are necessary for every likely usage of the chip.  Looking at the chip's datasheet, I see that it always suggests that you use a couple of caps for power supply decoupling, so I included 0.1 uF and 10 uF capacitors in my design.  Also, after looking through the datasheet, I decided that I was never going to want to change the reference voltages applied to the chip, so I just tied those pins to the power supply, which the datasheet said was fine.

The centerpiece of this design is, of course, the MCP4922 chip itself.  Note that labeling on its symbol is poor ("REFDES TYPE", what is that?).  The problem is either that I don't know how to use Eagle (which is true) or that the device model itself is poor because it was robo-translated to Eagle format from the generic format provided by Microchip.  When I was done, I found a model for the MCP4922 in the Adafruit Eagle library.  I should have used that version of the model instead.  But, what's done is done.

2-Layer PCB Design as Performed in Eagle.  Red traces are on the top layer.  Blue are on the bottom.
After completing the schematic, I switched Eagle over to its PCB layout mode.  With a friend's help on how to use the program, I whipped out the design above.  Note that the traces use a few different widths...some are fat and some are skinny.  The inconsistency is my fault and it is only partly by design.  The default trace size is very thin.  I thought it important that the power and ground traces be thicker, especially between the IC and the decoupling caps.  So, I thickened those particular traces by hand.  I did not do a great job.  In the future, I'll try Eagle's "nets" feature so that the trace thickness is more automated.

You'll also note that everything on the PCB is through-hole, except for the two caps, which are SMT (surface mount).  This will be my first time soldering SMT.  Caps are pretty easy, so this should be good training for me.  If it goes well, maybe I'll use more SMT for my future, bigger circuits.

After completing the PCB layout, I had to choose where to get the board manufactured.  Being a fan of Sparkfun, I remembered one of their blog posts that talked about their BatchPCB service being merged with OSH Park.  So, I checked out OSH Park and it looked like a pretty good deal (2-layer board for $5 per square inch, and you get three copies).  A key benefit for me was that OSH Park allows you to upload your Eagle file directly, without going through the error-prone process of exporting Gerber files.  For a newbie like me, that's outstanding.

Before sending my PCB design to OSH Park, I downloaded their DRU file for Eagle, which specifies all of the design limits used in their manufacturing process.  This is important to ensure that your design can actually be fabricated.  When I ran the DRU check on my PCB,Eagle reported some errors with my design.  Mainly it saw that all of my "text" was assigned to the wrong layer.  If I didn't change anything, my "text" was actually going to be printed copper traces on the same layers as the rest of my traces.  This would have shorted everything out!  Oops!  Thank you DRU check!  So, I corrected the problem by moving my text to the correct layer ("21" in Eagle) and re-ran the DRU check.  Now everything was good.

I uploaded my design to OSH Park.  After processing the Eagle file, the OSH Park page produces a bunch of images of my board (like the one at the top of this post) so that I could check the design.  I noticed that some text was written wrong, so I fixed that in my Eagle file and uploaded the design again.  I iterated like this 3 or 4 times before I was happy.  When I was eventually satisfied, I accepted the design.  It's going to be $5.85 for three copies and the shipping is free.  What a deal!

Now I wait for them to arrive.   And to see what design errors I made.  Isn't this hobby fun!?!

(Oh, I shared my PCB design on OSH Park.  If you're curious, you can see it here.)

Follow-Up: The PCB's have arrived!  Check it out here.
Follow-Up: I've assembled the PCB.  Check it out here.
Follow-Up: I've tested the PCB.  It works!  Yay!  Check it out here.

Follow-Up: I've designed my second PCB.  Much more complicated.  You can check out the story here.

Saturday, August 31, 2013

Polysix - Flatten the Treble Response

Previously, I modified my Korg Polysix to remove the post-effects VCF.  To my ears, this mod nicely opened up the sound of the synth.  Others, though, thought that it now sounded too "raspy", which might be a way of saying that it now had too much treble.  That's a fair criticism.  In this post, I discussed how the Polysix has a built-in treble boosting circuit to partially compensate for its previous lack of treble.  Since my modifications to the post-effects VCF  restored some of the synth's treble deficiencies, the treble boost circuit might now be over-compensating.  Today, I discuss how I modified this circuit (in particular, around R168) to try to flatten its treble response.  As usual, let's first jump to the end of the are some audio demos illustrating the effect of the mod to flatten the response.

Korg's built-in treble boost is on the KLM-368 Effects PCB.  An excerpt of this part of the schematic is shown below.  Looking at the schmatic, one can see the main part of the audio signal passes through R168, where it is attenuated as a voltage divider with the 1K resistor to ground.  In parallel with this main path, the elements circled in blue provide a second path for the higher frequencies, which means that the treble passes through with less attenuation than the lower frequencies.  By being attenuated less, the result is that the treble frequencies appear to be boosted relative to the lower frequencies.  In my most recent frequency response measurements of my Polysix, I saw that the boost starts around 2 kHz and peaks around 12 kHz.  At the peak, the boost is about 4-5 dB.  For a vintage synth, 12 kHz is very high is basically just the "sizzle".  When boosting the sizzle by 4-5 dB, some ears might indeed find the new sound to be a bit obnoxious.

So, I looked at ways to flatten the treble response to reduce any obnoxiousness.  The most obvious modification would be to simply remove the elements circled in blue.  Unfortunately, that does not work well because some treble boost is needed to compensate for treble loss elsewhere in the system.  So, if we want to flatten the response, we need to adjust -- but not eliminate-- the treble boost of this circuit.

After some trial and error, I settled on the approach of adding a resistor in parallel with R168 (the 22K resistor).  The idea here is that, by adding a resistor in parallel with R168, I'm lowering the overall attneuation of the direct path while leaving the treble path unaffected.  Therefore, the relative boost of the treble via blue elements is lower when compared to the now-lessened attenuation of the direct path.  If the relative boost is lower, the overall frequency response will be more flat.  In the end, the best value for me was to add a 33K resistor in parallel with R168.

Implementing the modification is pretty straight-forward...just add a 33K resistor across the existing 22K R168 resistor.  Unfortunately, because of my modification to remove the post-Effects VCF, I already have a jumper wire flying into one leg of R168.  You can see what I did in the picture below.  The blue resistor is the newly-added 33K.  Below it, and slightly behind it, the tan resistor is R168.  You can see that I curved the leg of the blue resistor in a funny way so that it stuck out before looping back and connecting to the leg of R168.  Because of the perspective, you cannot see it loop back to connect to R168.  I then connected the yellow wire (my jumper wire going around the post-Effects VCF) to the looping leg of the blue wire.  Done.  Note that the green capacitor has not been touched in this modification.  The angle of my photograph may look like it is connected to my modification, but it is is just unfortunately aligned in the background.

Adding the blue resistor (33K) in parallel with the R168 (the tan resistor underneath and behind the blue resistor).  The yellow wire is the audio input coming from my modification where I removed the Post-Effects VCF.  The green capacitor is not involved with this modification.
After doing this modification, I re-measured the frequency response of the synth (using the Maximum Length Sequence technique discussed here).  A comparison of the original and modified response is shown in the graph below.  As you can see, adding the 33K resistor did indeed boost the response through the low and mid frequencies.  The relative weighting of the high treble to the rest of the tone is now more balanced.

A side-effect of this mod is that the signal level is overall about 3-4 dB hotter going into the IC20.  For the loudest sounds, this might cause it to saturate a bit...for it to add a little compression or distortion.  I'll be keeping my ear tuned for that possibility.  Since Moog, with their Sub Phatty, has been extoling the virtues of adding a little OTA distortion, maybe any slight overdrive added here would be a good thing.  I'm not convinced either way, but I will keep my ear open for it.

So how does it sound?  Well, the sound samples at the top provide a comparison.  These are recordings straight from the synth to my M-Audio Microtrack.  Because the modified version was 3-4 dB louder, and since we humans are very sensitive to (and partial to) louder sounds, I cut the volume of the samples from the modified synth by 3.2 dB to equalize their RMS power.  So, even though I did not equalize their volumes on an A-weighted scale, hopefully I'm close enough that it is a fair comparison.

Do you think that the treble-flattening modification sounds better?  Or does it sound too dull?  I'm curious to hear your thoughts!

Follow-Up: I had this mod in my synth for a couple weeks.  I decided that I preferred the super-sizzly sound that I had before, so I removed the 33K resistor.

Monday, August 26, 2013

Polysix Deeper Bass - Properly Jumpering C61

Following this post and this one, I've decided that I like the sound of my Korg Polysix when bypassing C61.  So, I've decided to remove the clip leads that were shown in the pictures in those previous posts and replace them with a proper jumper wire.  So, I cut one to length and soldered it in.

The Red Wire Jumpers Around C61 by Connecting the Left Leg of Q15 with the Right Leg of R115.

Again, the Red Wire Jumps from the Left Leg of Q15 to the Right Leg of R115.
Now, I agree that the proper thing to do would have been to remove C61 and to solder a jumper wire into the holes of C61, but I didn't want to do that.  I just soldered in the red jumper wire shown above.  I don't perceive any additional added noise by using this flying lead, so I think that it's probably OK.  Plus, if I choose to un-do this mod, removing the red wire is easier than finding and installing a replacement for C61.

Smell the solder!

Sunday, August 25, 2013

Polysix - Frequency Response with Deeper Bass

In my previous post, I modified my Korg Polysix to strengthen the deepest bass frequencies.  The key is to bypass (or remove) C61 on the KLM-368 Effects PCB.  In my previous post, I attempted to show the frequency response due to this modification, but the graph was pretty poor.  Today, I have taken new measurements and made a much better graph.  Now we can clearly see the effect of bypassing C61.

Lower Cutoff Frequency:  This graph clearly shows that the low-frequency cutoff for the synth drops substantially by bypassing C61.  As measured at the -3dB point, removing C61 drops the cutoff from about 62 Hz down to about 20 Hz.  This means that removing C61 extends the deepest bass frequencies.  Whether or not this is a good idea is up to you.  For me, after living with it for a few more days since my original post, I like it.  I think that I will keep it.

Let's talk about some details of the measurement technique...

Measurement Approach:  By treating the Polysix as a "black box" system, I evaluated the frequency response by measuring the transfer function of the "black box".  I did this using a standard technique -- I injected a known broadband signal into the system and I recorded the output signal that was generated by the system.  Comparing the output to the input yields the transfer function.  By looking at the transfer function in the frequency domain, you get the frequency response of the system.  In this case, of course, the "system" is my Polysix.

Injecting the Test Signal:  All of the circuits that interest me at the moment are on the KLM-368 Effects PCB.  To measure its frequency response, I need to inject my signal before the audio pathway gets to KLM-368.  I chose to inject my signal at the end of Voice 1 on KLM-366, just before it is mixed with the other voices and sent off to KLM-368.  As seen in the picture below, I injected my signal at R133.  To allow my signal to mix properly into the synth's audio path at this point, I used a 10K resistor in series between my computer (which is playing the signal) and the green clip lead shown in the picture.  For the "output" of KLM-368, I simply recorded the main output of the synth because there is very little circuitry after KLM-368.

Injecting my Signal on the Lower Leg of R133 (the Green Clip).  Not shown is the 10K Resistor Between my Signal Source and the Green Clip.
Processing with Matlab:  To produce the frequency response graph shown at the top, I processed the audio recording of the input signal and of the output signal using Matlab, which is unfortunately not cheap nor readily accessible.  It is a very good programming environment for doing this kind of signal processing, but there are other choices.  The Matlab functions that I needed are the FFT function (which converts time-domain signals into frequency-domain signals) and Matlab's plotting functions.  As an alternative to Matlab, I believe that this analysis could be easily done in Octave (which is free) because it has a perfectly fine FFT function, as well as, perfectly fine plotting functions.

Compute the Transfer Function:  Whatever computational tool you use, the core of the calculation is to take the FFT of the output audio and divide it by the FFT of the input audio.  This division operation in the frequency domain yields the output/input transfer function of the system being measured (in my case, KLM-368).  Take the magnitude of the transfer function, plot as "dB", and you've got the amplitude response as a function of frequency.  This is what I show in my graph.

Chosing the Input Signal:  For anyone who has made these kinds of measurements before, you know that there are several different choices for "broadband" input signals that one can use.   Ideally, the input signal is flat in the frequency domain, so that any deviation from a flat output is most easily assessed.  The typical choice is to use either a linear frequency sweep or some random white noise.  Personally, I like to use noise.

Maximum Length Sequence:  In the category of "random white noise", I chose to try something new...instead of traditional Gaussian white noise, today I tried using a Maximum Length Sequence.  Unlike traditional white noise, which is only truly flat in the frequency domain after lots and lots of averaging, an MLS sequence is designed to be perfectly flat within whatever fixed period of time that you'd like.  As a result, you get much smoother results in a much shorter recording.

Smooth MLS Results:  I generated a sample of MLS using the "MLS.m" routine downloaded from the Matlab File Exchange. I generated the sequence and saved it out as WAV file, just like I would do for any other noise sample.  After running it through the synth and processing the results, I get the very nice graph seen at the top of this post.  This is the first time that I've used MLS and, given the smoothness of the graph (copied again below, but with different annotations), I like how the results turned out.

One More Look at the Graph:  OK, sorry for the digression about transfer functions and maximum length sequences.  Let's get back to the results at hand.  However I got there, this new graph shows the frequency response of the synth much better than my old one.  It shows that the effect of bypassing C61 is substantial, but only at the deepest frequencies.  As a secondary result, I also see that the KLM-368 PCB (with or without C61) produces a sizable boost seen in the treble frequencies.  I believe that this is the effect of Korg's built-in treble boost that was discussed in this older post.  I'm going to address this "feature" in another post later.

Update: I decided to properly bypass C61 using a jumper wire instead of my clip leads. See here.

Tuesday, August 20, 2013

Polysix Deeper Bass - Bypass C61

Ever since this post back in February, I've been interested in optimizing the frequency response Korg Polysix.  In that post, I discussed how both the highest treble frequencies and the lowest bass frequencies diverged from a pure sawtooth wave.  Later posts (especially this one) discussed how I modified the treble response to get what I wanted.  By contrast, the bass response seemed to diverge from the ideal only by a little bit, so I didn't put much thought into it.  As part of his post on Yahoo Groups, though, Tony from Oakley Sound remarked that C61 on KLM-368 appeared unnecessary and couple probably be removed.  Being an AC coupling cap, C61 naturally acts as a high-pass filter, which could possibly affect the bass response.  So, if I want more bass, maybe I should remove it.  Here, I discuss how I bypassed that cap.  To get straight to the good stuff, below are audio comparisons of the "before" and "after" (you'll want good speakers or headphones...we're talking about changes mainly to the deepest bass frequencies!):

The modification that I performed is located entirely on the KLM-368 PCB ("Effects").  An excerpt of the schematic is shown below.  C61 is a 1 uF electroltyic capacitor that the uneffected must audio pass through.  If you want to remove this cap, you could simply de-solder it and put a jumper in its place.  If you merely want to try the mod without removing any components, you could instead use clip leads to jumper from one leg of C61 to the other leg.  Unfortunately, my C61 was soldered too tightly to the PCB, so I chose to jumper between the easily-accessible points on R115 and Q15.

On KLM-368, Bypass C61 by Using a Jumper Wire from R115 to Q15
A photograph of my modified circuit is below.  The green wire is my added jumper.  Also in the frame, but unrelated to this modification, is the yellow wire and the empty IC socket.  Those changes were performed as part of a different mod to remove the post-effects VCF, which improves the apparent attack of the synth and which alters the high frequency response of the synth.  More info on that mod can be found here.  Today's mod, though, is just about the addition of the green wire.

The Green Jumper Connects the Right Side of R116 to the Left Leg of Q15
To assess the impact of today's modification, I recorded the audio at the synth's main output.  I recorded it with my trusty M-Audio Microtrack, which I used for all my previous assessments of the frequency response of my Polysix and Mono/Poly.  For this test, I set the Polysix for a simple sawtooth waveform, using the lowest octave.  I set the VCF to about "5" with no resonance.  Below is a visual comparison of the raw waveforms output by the Polysix when playing the lowest "C" on the keyboard.  The top plot is the unmodified Polysix, which has its C61 in place.  The bottom plot is the modified Polysix, which has C61 bypassed using my green jumper wire.

Recorded Output of the Lowest "C" with a Sawtooth Waveform (VCF at "5")
In this plot, you can see that the unmodified Polysix decays back to zero (which is the red horizontal line) more quickly than with the modified Polysix.  Remember, the synth is trying to do a pure sawtooth wave, so any "decay back to zero" is an indication of some amount of low frequency attenuation in the synth.  The fact that the modified Polysix decays back to zero less quickly means that it has better low frequency performance.

If we're discussing frequency response, we really should be looking at the signals in the frequency domain.  So, below, I do a frequency analysis of two 5 second audio samples of the output of the synth.  The blue trace is the unmodified Polysix, which has the C61 in place.  The red trace is the modified Polysix where C61 has been bypassed.  Again, this if for the lowest "C" on the keyboard, which has a fundamental frequency of about 32.8 Hz.  That is a *very* low frequency.  Comparing the two traces, we see that bypassing C61 seems to increase the synth's response at this frequency by about 6 dB.  That's a pretty big change!

Comparing the Frequency Content of the Lowest "C" Using a Sawtooth Waveform (VCF at "5")
In the real-world, 32.8 Hz is too low for our loudspeakers or headphones to reproduce accurately (especially for hobbyists like me).  So I'm not sure that I'm able to hear the impact on these deepest bass frequencies with my equipment.  But, you'll see that the next couple of harmonics (66 Hz, 99 Hz) are also slightly stronger after the modification.  My system can easily reproduce these frequencies.  So, when I'm playing my synth (or when I'm playing the Soundcloud demos at the top of this post), I do hear a difference between the unmodified and modified conditions, I'm just not sure its the change at 32.8 Hz that I'm detecting.  That is some seriously deep bass..

Given that I do hear some difference in tone (whether at 66 Hz or at 32.8 Hz), which version do I prefer?  Certainly, for raw visceral excitement, I like the added thickness and rumble of the full bass experience resulting from bypassing C61.  But, the Polysix isn't intended to be a deep-bass rumble machine -- it isn't supposed to be a Minimoog, or even a Mono/Poly.  Instead, it's a polysynth meant for chords and pads and strings and such.  So, when used for these purposes, perhaps my modified Polysix now as too much bass.  I think that it might sound too thick, too bloated.

It's interesting (to me) to note that the Polysix's main competition back in the day -- the Roland Juno 6/60 -- includes a high-pass filter as part of its architecture.  One use for the HP filter is to cut the low-end rumble to purposely make the sound more skinny.  For chord stabs, a skinnier sound can often sit better in the mix, especially when you've got other instruments providing a deep and punchy bass line (such as for dance music).  Perhaps this ability to control the low end bloat to sit better in the mix is why the Juno's continue to be more popular than the Polysix.

But that's a digression...

Back on the topic of the increased deep bass on my Polysix, I'm still deciding whether or not I like the modification.  I'm going to have to live with it for a while to see.  Thoughts?

Update: Better frequency response graph here along with more discussion of how it's done.
Update: I decided to properly bypass C61 using a jumper wire instead of my clip leads. See here.

Friday, August 16, 2013

Polysix - Disabling the Built-In Detuning

As many of you know, I replaced the Key Assigner in my Korg Polysix with an Arduino and a DAC chip. The flexibility of this setup allows me to do all sorts of arbitrary pitch manipulations such as pitch bending, aftertouch-driven vibrato, and pitch detuning. My implementation of detuning was discussed in this post and I really enjoy having that capability.  One incomplete aspect of my detuning modification is that I did not properly address the interaction of my detuning with the fixed amount of detuning that is already added by the Polysix when it is set to Unison mode.  This fixed amount of detuning confounds my ability to properly add just the right amount of own amount of detuning.  So, as described below, I've decided to simply disable the Polysix's built-in detuning.

The schematic above is an excerpt from the KLM-366 PCB.   It shows the elements that create the fixed amount of detuning when the Polysix is in Unison mode.  When in Unison mode, the Polysix enables this circuit  by applying a LOW voltage to Pin 6.  This allows IC30 to do its job -- which is to take the "detune" voltages created on the right side of the chip (along with R116) and multiplex them onto the "X" pin.  The multiplexed output then goes off to get added with the main Pitch CV signal so that the combined Pitch CV signal creates the pitch that you desire plus the small amount of detuning generated by this circuit.  When the Polysix is in any mode other than Unison, the Polysix applies a HIGH voltage to Pin 6, which disables this chip and prevents the detune voltages from being output.

To disable this built-in detuning feature, I am going to apply 5V to Pin 6 so that the chip is always disabled.

To implement this modification, I need an easy source of 5V and I need an easy place to inject it into Pin 6.  Looking at the full schematic, and looking at the real-life PCB, I see that I can grab 5V off R121 and I can inject the 5V via R118.  The trick is to grab the correct side of R121 and of R118.  After a little probing using my multimeter in "continuity test" mode, I found the side of R121 that was connected to 5V (the left side) and I found the side of R118 that was connected to Pin 6 of IC30 (the right side).  As shown below, I soldered a short jumper wire and gave it a try.

I added the short red wire in the middle to jumper R121 to R118
The result is that the detuning has been successfully disabled.  Now, when I switch to Unison mode, it sounds just like if you load up the Chord Memory function with 6 of the same notes.  If your Polysix is in really good tune, you get a single tone with a very slow phasing sound.  Then, when I activate my own detuning, the 6 voices spread apart by a controlled amount, which is what I want.

It's a nice and easy modification that achieves my goals.  I do think that detuning is an important part of the Unison sound, so I do not recommend this modification if you have no other way of creating the detune effect.

In fact, if you're relying upon the built-in detuning, my taste would have preferred more detuning.  If you, too, like a good amount of detuning, you can easily increase the built-in amount of detuning by changing R116.  A larger resistor will result in more detuning -- a smaller resistor will result in less.  Try a couple values and you'll find what you like!

Thanks for reading...

Tuesday, August 13, 2013

Polysix - Permanently Removing the Post-Effects VCF

After living for a while with my non-destructive version of bypassing the post-effects VCF, I've decided that I really like it and that it is probably something that I want to keep.  Because the clip lead that I had been using is not a robust long-term solution, I decided that I would make this modification more permanent.  So, I replaced the clip leads and soldered in a single wire in its place.  It's pretty straight-forward...

I soldered a jumper wire from J28 to R168, thereby bypassing the now-empty socket for IC15.
The sound is the same as before, but the synth will now be more robust as I travel with it.  If I ever want to un-do this mod, I simply un-solder the single wire and put the LM13600 back into the empty IC socket.  Easy!

Sunday, August 11, 2013

Polysix - Modifying the MG Delay Circuit

As I've been discussing in the last few posts, the MG Delay circuit on my Korg Polysix doesn't work quite right -- even with an MG Delay of zero, it still suppresses my MG signal at the start of each new note.  In my most recent post, I found that my MG Delay control voltage (CV) from the Polysix DAC is still a tiny bit too high, even when set to zero.  Since I can't do much about the DAC, I chose instead to modify the keypress signal that is compared to the MG Delay. The result is that my MG Delay now works as I think that it should -- when set to zero, the MG signal is applied smoothly across all notes, with no MG transients at the start of the notes.  Below is an audio demo with the MG Delay modified (top) compared to how it sounded on my Polysix prior to modification (bottom).  In addition to the MG Delay being set to zero in both cases, all of the other settings are the same, too.

Find the MG Delay Circuit:  A schematic of the relevant part of the Polysix circuitry is shown below.  The MG Delay functionality is effected by IC14, which compares the MG Delay CV produced by the DAC sample-and-hold (arriving at Pin 2 of IC14) to a voltage signal that pulses which each new keypress (arriving at Pin 3 of IC 14).  Whenever Pin 3 goes lower than Pin 2, the MG is suppressed.  I'd like modify the circuit so that, when the MG Delay is set to zero, the voltage at Pin 3 does not drop below whatever voltage is being delivered by the DAC to Pin 2.

Swap R98 to Control the Voltage Drop at Pin 3:  The voltage at Pin 3 drops with each new keypress because a keypress causes Q5 to conduct, which allows the charge stored in C33 to drain out via R98. Because Q5 only conducts for a short amount of time, we can limit how low C33 gets by constricting the flow of charge out of C33.  The easiest way to do that is to simply swap R98 from its default 4.7K value to a higher value.  At first, I tried 20K, but decided that 10K was better.

Removing R98.
New R98.  I first tried 20K.  I settled on 10K.
Viewing the Impact of R98:  To visually confirming that I correctly affected the voltage at Pin 3, I used my oscilloscope to view the voltage at Pin 3 (as altered by my modification of R98) and the voltage at Pin 2 (the MG Delay CV).  As shown in the picture below, changing R98 now keeps the voltage at Pin 3 from dropping below the MG Delay CV that is being applied to Pin 2.  As a result, the output of IC14 now stays high, which means that the MG signal is not suppressed by the start of the note.  Success!

Ensuring I Did Not Over-Correct:  It would be very easy to use too large a value for R98.  How do you know that you have an OK value?  If the resistor were too large, then the MG Delay functionality would be defeated for values other than zero.  I'm not trying to completely defeat the MG Delay, I just wanted zero to be zero.  So, to make sure that my MG Delay still worked well, I turned the MG Delay knob a little bit until the DAC put out a higher MG Delay CV.  It turns out that there is a pretty big dead zone on my MG Delay knob (that is unrelated at all to changes to R98)...I had to turn my knob all the way up to "1" in order to see the DAC output tick up one notch.  Once I saw it tick up, I retested the voltage at Pin 3 to ensure that it dropped low enough to trigger the MG suppression.  With my initial change to an R98 of 20K, Pin 3 did not drop low enough.  By swapping R98 to 10K, I got the result shown in the picture below.  As you can see, Pin 3 does indeed drop briefly below Pin 2, as desired.  Success!

So, with this modification, I have achieved my goal of making the MG Delay work as I want.  When turned to zero, the MG Delay is defeated.  When turned slightly above zero, the MG Delay works as before.  I'm pleased.

Polysix - Exploring the MG Delay Circuit

As discussed in my previous post, the "MG Delay" on my Korg Polysix seems to have a problem.  On my Polysix, there is always a delay between pressing a note and getting the MG effect, even with the MG Delay at zero.  I still don't know whether all Polysix's do this, or just mine.  Either way, I'd like to fix it. In this post, I dive in to try to see why my Polysix does this.  My goal is to find spots where I could modify the circuit to make it perform the way that I want.

First, let's look at the part of the schematic that controls the modulation generator (MG).  It's on KLM-367 and I've excerpted the relevant bits in the figure above.  I've highlighted four sections of the circuit: (1) DAC Sample-and-Hold, (2) "MG Delay" Comparator,  (3) "MG Amount" VCA, and (4) the MG Oscillator.  Let's work backwards from the end to see where the MG behavior deviates from what I'd expect.

View the Overall MG Output:  I start by looking at the overall output of this collection of circuits.  The overall output is on the bottom right at point "J".  This point yields the oscillating MG signal itself, including any modulation of the MG signal due to pressing a key on the keyboard.  You can easily access this point in the Polysix by clipping an oscilloscope probe to TP5, which stands proudly on the left side of KLM-367.

Clipping into TP5 to see the MG Signal
I then used the Polysix's knobs to configure the MG with frequency turned really high, with the delay set to zero, and with the level set to maximum.  I set the MG slider switch set to send the MG to the VCA.  When you set the MG in this way, and if you look at the signal at TP5, you usually see an oscillating triangle wave.  This is normal MG signal.  On my synth, when you press a key on the keyboard, you see the that the MG signal becomes suppressed for about 100 ms.  While this is exactly the effect expected when employing the "MG Delay", I think that it is wrong that it occurs even when my MG Delay set to zero.  In my opinion, when set to zero, there should be no gap at all.  So, while I'm not pleased that we are seeing a gap, I am pleased that I have confirmed that it is occurring at TP5 -- it means that I can continue to chase it back through the circuit.

Signal measured at TP5, Where a gap in the MG signal is seen even with MG Delay set at zero.
"MG Amount" VCA:  Looking at the MG signal shown above, we see that the amplitude of the MG signal is being reduced (attenuated) due to the keypress.  If we look at the circuit schematic, we see that the last block of circuitry prior to point J is a voltage-controlled amplifier (VCA) based around IC21, which is a classic LM13600 trans-conductance amplifier.  I've highlighted this part of the circuit in yellow.  We see that the VCA is being given the basic oscillating MG signal from the circuitry in blue.  Controlling the gain of the VCA is a combination of two signals: (1) the "MG Amount" voltage output by the DAC sample-and-hold and (2) the "MG Delay" Comparator voltage output from IC14.  Since its the influence of the "MG Delay" that I'm trying to explore, let's look at the "MG Delay" comparator (IC 14) in more detail.

"MG Delay" Comparator:  IC14 is an operational-amplifier that appears to be configured as a comparator.  Its output will be high if the voltage at pin 3 is greater than at pin 2.  Its voltage will be low if the voltage at pin 3 drops below pin 2.  If we consider the "output" to be the voltage at R79, the diode (D12) and the cap (C34) will slow the transition from low-to-high, but the overall idea of the comparator is the same.  Let's probe it to see...

Measuring Pin 3 on IC 14 using the red clip on R86.  At the bottom, probing R79 directly.
The figure below shows the signals around IC14 to see what happens when I press a key on the keyboard.  Again, this figure is with the "MG Delay" set to zero.

As you can see, the voltage at pin 3 drops from high to low when there is a keypress.  If I were to zoom out, you would see that the voltage at pin 3 slowly recovers back to its high state over a couple of seconds as C33 is charged up from +15V via R86.  Because of the slow recovery at Pin 3, the voltage at Pin 3 is, in effect, a measure of time since the last new keypress.  Looking at the yellow trace in the picture above, we see that the output of the comparator (as measured at R79) is normally high and then drops as soon as the key is pressed.  In this case, the output then smoothly recovers back to its high value after a short passage of time.  Because the voltage at R79 controls the gain of the "MG Amount" VCA, this drop at R79 is causing the suppression of the MG signal that we saw earlier.  With the "MG Delay" set to zero, I would not expect to see any suppression of the MG signal, which means that I would not expect to see the voltage at R79 drop.  But we do see it drop.  Why is it dropping?

Comparing Pin 2 to Pin 3:  The voltage of R79 is driven by the output of IC14.  The output of IC14 is driven by a comparison of the voltage at Pin 3 to Pin 2.  Let's probe these these two signals.  

Measuring Around IC14.  Pin 3 is via the red clip at R86.  Pin 2 is probed directly.
In the o-scope picture below, note that I've zoomed out the time axis relative to the previous o-scope picture.  As you can see, the red line is the voltage at pin 3, which shows the quick drop from high-to-low as the key is pressed and it shows the slow recovery in voltage as C33 is charged back up.  The yellow trace shows the voltage at Pin 2, which is the voltage produced by the DAC sample-and-hold to represent the "MG Delay" setting.  For clarity, I've turned the "MG Delay" knob up to a value of "2", which raises the voltage at Pin 2.

You can see how the voltage at Pin 3 is normally higher than the voltage at Pin 2.  You can see that, when the key is pressed, the voltage at Pin 3 drops below the voltage at Pin 2 for a brief period.  That drop of Pin 3 below Pin 2 is what causes the output of IC14 to drop, which is what causes the voltage at R79 to drop, which is what causes the gain of IC21 to drop, which is what causes the MG signal to be suppressed.  It's like dominoes falling in a line.  Great!  This behavior makes total sense when the "MG Delay" is set to "2".   But I'm seeing MG suppression even with "MG Delay" set to zero.  Let's look to see what happens when we drop the "MG Delay" back to zero...

So, as expected, the voltage at Pin 2 is lower because I turned the "MG Delay" knob from "2" down to "0".  In this view, it is unclear whether Pin 3 drops below Pin 2.  Let's zoom in...

Pin 3 Drops Below Pin 2:  Now we can see that, even with "MG Delay" set to zero, the voltage at Pin 3 does indeed drop below the voltage at Pin 2.  It is brief (~5ms), but it happens.  This would cause the output of IC14 (ie, Pin 1) to pulse low for a similar time period.  But our MG is suppressed for 100ms, not 5ms.  Well, the diode D12 allows even that short downward pulse at Pin 1 to discharge the cap C34.  The diode then prevents IC14 from charging C34 back up.  Instead, current must leak through both R78 and R79 to charge C34.  This takes time.  As a result, even a short 5ms pulse from IC14 causes the voltage at R79 to drop quickly but to stay low for a while as it is slowly charged.  Since R79 controls the gain of IC21, even this slight difference between Pin 3 and Pin 2 results in a noticeably long (100 ms) suppression of the MG signal.

What to do about it?  If the picture above were seen for an "MG Delay" setting other than zero, everything would be fine.  The problem is that, for an "MG Delay" of zero, the voltage at Pin 2 should be low enough that it is always below Pin 3.  If that were the case, the output of IC14 would always stay high, which means that the MG signal would never be suppressed.  This is not the case in my Polysix.  It appears that my "MG Delay" CV does not go low enough.  Unfortunately, even after readjusting my DAC (using the brief instructions in the Polysix Service Manual), the "MG Delay" voltage is still a bit too high and my MG still gets briefly suppressed with each new keypress.  My alternative, therefore, is to adjust the behavior of the voltage at Pin 3.  If the voltage at Pin 3 did not drop quite as low, it would stay above the voltage at Pin 2, thereby avoiding the suppression of the MG signal.  The voltage at Pin 3 could be adjusted in a number of ways.  I'll look at these possible modifications in my next post.

Update: I've modified the circuit so that MG Delay of zero works as desired.

Wednesday, August 7, 2013

Polysix - MG Delay of Zero is not Zero

Earlier this week, when playing my Korg Polysix, I noticed that the LFO ("MG") was not having the effect that I expected.  I often like to set the MG to sweep the VCF very slowly, especially when playing the arpeggiator.  Based on my experience with the Korg Mono/Poly, I expect that the slow MG sweep would cause the arp notes to smoothly change their brightness from note to note.  Unfortunately, that's not what my Polysix is doing.  As you can hear in the soundcloud sample below, there is a clear transition at the start of each note where the VCF goes from its default value (as set by the VCF Cutoff knob) to the current value of the MG.  If you have a Polysix, does yours do this?

The settings for this sound are shown in the pictures below (MG Freq = 2, Delay = 0, Amount = 6, VCF Cutoff = 5, Resonance = 0, EG Intensity = 0, KBD Track = 0).

To show visually illustrate this unexpected audio behavior, check out the screen shots below.  These are screen shots of the audio in the sound cloud sample above.  Each segment shows four notes from the arpeggiation.  The top figure is when the MG is at the high end of its cycle, which means that the MG is opening the VCF beyond the setting from the VCF Cutoff knob.  As you can see in the screen shot, the note clearly starts at a lower VCF setting and then, after ~100 milliseconds, the filter opens up to the value defined by the MG.  This is with the MG Delay at zero!  It should not be like this.  The bottom figure shows the same thing, except where the MG is at the low end of its cycle where the MG is closing the VCF to a value lower than that set by the VCF cutoff knob.  Again, there is ~100 ms delay before it transitions to the MG's value.  In my mind, it should not be this way...the beginning of each note should be no different than the middle of the note.

Even with MG Delay set to Zero, There is Still ~100ms Before the MG Affects the Sound
So, I don't think that it is supposed to work this way.  Unfortunately, I don't know whether this is a new behavior of my Polysix (ie, it has become broken) or if it has always been this way (ie, it is a "feature" of the Polysix design).  If you have a Polysix, does it respond like this?

Update: I explored the MG circuit to find the cause of this behavior

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.