Get a site

the wondrous tales of a software guy in hardwareland

Tune In To The Melody

Yesterday evening I went for some “soft” activity. No making, no soldering, no cutting, no millimeter-accurate planning. Just stress-free breadboarding and coding. Also, music :-)

The goal was to tune the monotron. I made it sound already, but with more or less random voltage from the DAC. I needed to get the numbers to actually produce notes, or some musical pitch anyway.

So I rebuilt my DAC circuit and started experimenting. Actually, I built myself a sort of test harness: the DAC connected to the monotron, two buttons to increase/decrease the pitch and a knob for fine adjustment.

Let’s look at the numbers: the DAC is 12 bit, which means 4096 values. On a range of approx. 5 volts, this makes something like 819 values per volt, or 1.2mV per value. Actually, the DAC doesn’t go up to 5V: according to the datasheet the output range is 40mV to Vdd-40mV, but OK, we are in the ballpark anyway. I configured the buttons to add or subtract 10 from the current pitch, and scaled the knob from 0 to 9. Here is it in all its glory:

monotron tuning harness

Then I routed the monotron output to the computer mic and fired an instrument/guitar tuner program. I’m on linux, so I used rackarrak (which actually does much more) but you could use LINGOT or FMIT as well.

Well, looks like the pitch of the monotron is not exactly stable :-) Even with constant value from the DAC, it floats by some Hertz, making the tuner pretty mad. Maybe it’s the nature of the oscillator, or maybe the voltage from the laptop’s USB isn’t stable. Whatever, I’m not a perfectionist, except when I am.

So with some time and copious button clicking, I was able to track the values for the A note at various octaves. For this, the monotron has been set to clean (no LFO modulation, cutoff max, no resonance) and the pitch knob to minimum.

  • DAC at: 1274 = A2 (~110Hz)
  • DAC at: 1915 = A3 (~220Hz)
  • DAC at: 2556 = A4 (~440Hz)
  • DAC at: 3210 = A5 (~880Hz)

Low values, eg. below 1000, don’t seem to alter the pitch substantially. And the tuner also doesn’t track low frequencies very well. At ~3790, the monotron reaches its limit. Pitch doesn’t increase after that, ending the range at ~1617Hz (near G#6). This leaves us a useful range of roughly 4 octaves and a half.

With the pitch knob of the monotron turned at maximum, the numbers become:

  • DAC at 290 = A7 (~3520Hz)
  • DAC at 944 = A8 (~7040Hz)

Limit is reached at 1480, ~12200Hz, after which the monotron doesn’t change pitch (instead, it decreases slightly). With the DAC at 0, the pitch is ~2585hz (near E7). Useful range: about 2 octaves. Of course, with the pitch knob anywhere between min and max, tuning has to be done manually. It’s analog, baby :-)

Anyway, the V/oct tracking seems to work quite good, with approx. 640 DAC steps between octaves. This means roughly 53-54 per semitone.

Armed with this knowledge, I setup a simple sequence to check the effective tuning. I went with the first two phrases of Ode An Die Freude, by our old friend, Ludwig Van. The result can be heard on SoundCloud:

The first loop is with pitch knob at minimum, then halfway up, then again low. In the last loop I cranked up resonance and added some cutoff modulation. SHEER POWER! Recording was done in Audacity, straight as it comes from the monotron (noise included). Lovely, isn’t it? :-)

If you are interested, I also committed the Arduino sketches on my github project:


, ,

Comments are currently closed.