I'm a big fan of small, toy synths and today we have the decidedly chintzy Gakken SX-150 mark II. It's the follow up to the SX-150 that was sold with the July 2008 issue of Gakken magazine.
There is a pre-production schematic for it, but I don't love the layout. As for board diagrams, there are none. So, I of course redrew it here.
Red-headed step ladder
There's not a lot to the synth, but the filter is interesting. It's a diode ladder filter (made from transistors) that closely resembles the 303's.
| TB-303 filter |
The biggest departure comes right before the output. The 303 uses a differential pair (Q21), but the Gakken replaces it with a differential amplifier (IC1B). The original transistor pair is actually a matched pair contained in one ic: the 2SC1583. This part is now rare and expensive, so they redesigned around the extremely common "jellybean" LM358 op-amp.
They let the other two matched pairs (Q22 and Q12) simply be separate transistors. Maybe they selected for close matches, but I'd guess they didn't, given the price point.
MIDI
It's not much of an instrument as it is, since it's very difficult to play any specific notes. The only interface is a stylus and a resistive strip that you touch it to. Let's add MIDI instead.
The combo of stylus and strip forms a voltage divider that yields values in the range of 2.5 to 5V. How exactly does this control the oscillator though? Let's look at the schematic.
| Gakken Oscillator |
Well, it has an exponential converter. That's very convenient for us. We can send our control voltage in via the "Strip" node. This is the point at which the stylus and the resistive strip meet. We can connect to this by alligator-clipping to the stylus tip itself. But, there's a snag.
Gate binds you
The "Gate" signal is derived from the Strip voltage. If the Strip voltage dips too low, the Gate goes low and disables the oscillator. This feature exists to prevent the VCO from droning when no note is being played (because there is no VCA!).
If we just remove R5, this decouples the pitch CV from the Gate signal. We can then use the "Strip" input to inject a gate signal instead, and connect a new resistor to the CV summing amplifier. What resistor should we use though? Well, let's look at the gain of the amp.
No pain, no gain
The original input resistor is 1M (R5), and the feedback is 470k (R21). `470000 / 1000000 = .47`. This gain is a bit high to be driving an exponential converter, but the value of feedback resistor is very high. This makes it easy for noise to to creep in and impact the pitch of the VCO, especially when experimenting using breadboards and jumper wires. So, let's reduce R21 to 47k.
Just from playing with the values, we can find that 120k gives a nice, wide pitch range. The gain is very similar to what it was before (.39 vs .47). It turns out it needs to be relatively high due to the voltage divider formed by R25 and R30 that lowers the gain down to .025.
Autotune
Now that we have a way to control the VCO, what voltages do we need to send to play a musical scale? That's going to depend on the exact value of components in a given SX-150, along with temperature (to some extent). We can add trimmers to hand adjust it, but we can instead make a microcontroller do the work for us. Previously we looked at a proof-of-concept guitar tuner made with an Arduino Nano R4. We can build on this for our autotuner.
Music is Math
The tuner code can only tell us what a given pitch is, but that's a good starting point. We can send a voltage to the VCO, measure the frequency, and then repeat with a different voltage. This gives us two points of data, and that's enough to tell us where all the notes lay (assuming a perfect exponential response). This is because only two points are needed to define the line that they fall on.
Here are two real world values that I got from one version of my tuning code. It tried to play note #12 and got note #-9.81. Tried to play note #36, got note #47.95. This gives us points (12, -9.81) and (36, 47.95). We can use our favorite middle-school-math™ to find the definition of this line, revealing the location of all notes. Remember slope-intercept form? `y = mx + b`
The slope (`m`) is defined by the rise (change in `y`) over the run (change in `x`):
`m = (y_2-y_1)/(x_2-x_1) = (47.95-(-9.81))/(36-12) ~~ 2.41`
The other component is the offset (intercept/`b`). We can get this by plugging one of our pairs into the equation, along with the slope that we just found.
`47.95 = 2.41(36) + b`
`47.95 - 2.41(36) = b`
`-38.81 = b`
We can graph this with Desmos, and see that the line: `y = 2.41x-38.81` does pass through our two points, and the intercept is at -38.81.
| Desmos graph of `y = 2.41x-38.81` |
Now we've worked out the relationship between the note that we request and the note that we ultimately get. How do we adjust the note we request so that we get the note we want though? We have to work out the opposite line that will compensate for the existing one. The inverse slope will fix the scaling, making a change of 1 note on the input cause a change of 1 note on the output.
It's worth pointing out that we can't change the original line's formula (without changing the hardware somehow); We can only modify our value of `x` that we put into it. So, here's `1/2.41x` plugged in for `x`, giving us:
Notice how the slope is a nice 45 degrees now, but it still starts on the very odd value of -38.81.
| `y = 2.41(1/2.41x)-38.81` in green |
What value could we add that would make our curve start from 0? It's tempting to say 38.81, to offset our -38.81, but that's not quite it. Remember the value will be multiplied by the original slope of 2.41. So, we need to again compensate for the slope and do:
`-b/m = -(-38.81)/2.41 = 16.10`
We can combine this with our slope, and rearrange terms so that it's more clear this is the inverse of the original line:
`y = m((x-b)/m) + b`
`y = 2.41((x + 38.81)/2.41) -38.81`
|
|
| `y = 2.41((x + 38.81)/2.41) -38.81` in green |
The Arduino can easily perform this math, and Tada; We have a synth that's in tune.
All the program has to do is find `m` and `b`, then plug them into this formula: `(x-b)/m` where x is your note.
In the future we may explore the tuning of non-ideal oscillators. In the real world you'll find that the SX-150 goes noticeably flat in the upper octaves. This is likely due to too much time spent resetting the saw waveform vs the short length of the cycle at high frequencies.




