Can you top a laser harp…?
After I published some of my earlier videos I get asked on a regular basis if I can create a MIDI interface that would work with any Theremin. So after completing the vacuum tube Theremin, I thought it was about time I put something together.
The hardware tracks threshold crossings of the audio output and uses a fairly comprehensive look-up table to match the fundamental frequency detected with a corresponding MIDI note value (assuming a concert pitch of A= 440Hz).
Volume information is also integrated over time to produce and envelope function that is mapped to MIDI volume data.
(Click the diagram above for a larger version. This covers the basic audio input system.)
Since I was using the LM324 opamp I wanted the whole system to operate with just a Gnd / +5v supply. The first phase is just a biasing network to get the AC input signal up into the active range for the opamp. Then a fairly standard design envelope follower. Finally a differential amp to scale the output back down to positive 0 to +5v, a buffer, a low pass filter and straight into the Analog input of the ATMEGA328.
Pitch preview is even simpler – a threshold comparator generates a square wave, and then the ATMEGA processes this on a positive going interrupt pin.
The real work takes place inside the ATMEGA328 – I used a MIDI synth and the above circuits to generate a look-up table of values. This lookup table (takes up a lot of RAM – hence the 328 and not 168) handles the non-linearity of the system, and since the values were derived on the system being used to track pitch, it takes into account any discrepancies in timing.
There are currently four modes of operation:
PITCH – tracking the frequency and output a corresponding MIDI note.
CNTRL – output MIDI controller data (currently set as #55 – general control #1)
ARP 1 – read input from a MIDI keyboard and ‘arpeggiate’ the chord described using the same chord “shorthand” used by the Casio MT-65/70 keyboards (Maj / Min / b7 / Min7)
ARP 2 – Construct an arpeggio around any chord combination held on the keyboard – up to 12 notes.
Volume data is transmitted in each of the modes. Switching modes can be accomplished via a footswitch, or panel switches.
So far I’ve been able to test it successfully with a PAIA Theremax, a Moog Etherwave, and the Keppinger Vacuum Tube Theremin – in all cases it performs very well.
It’s proven to be a very good training tool – as it shows you exactly where the notes are. With the addition of simple software to render the note on a computer screen you can test how linear the response of the Theremin is (I’ve even been able to plot the response on paper and use this as a playing guide.)
One of the criticisms of trying to interpret Theremin data using MIDI is the discrete nature of the digital form. Since the Theremin is a naturally continuous instrument a great deal of the expression can be lost when remapping the output into note data. Therefore a possible improvement would be to use the pitch detune information (currently driving the LED ladder) to operate the pitch bend function of the synthesizer – depending on how good the implementation of the synth engine is it should be possible to get a seamless transition of pitch from one note to the other. This would allow for the vibrato effect to be mapped out, with the 14 bits resolution operating over 1-2 tones. Hopefully this should prevent aliasing.
In the past I’ve just tried to use the pitch bend over a 2 octave range, but this is far from musical
There are software solutions out there, but they do involve having to take a laptop along to the gig.
I have designed a PCB that holds all the system components and power supply – if there is enough interest I might start selling these as a kit.
UPDATE : I made a slight change to the firmware so that the pitchbend is used to track pitch changes “in-between” whole semitones. Now the MIDI instrument tracks the Theremin pitch almost identically – with the same level of control and expression you get with the regular Theremin tone.
Now I have to quit making cool sound effects and do something musical with it