Moog Theremin T-Shirts
By Jason - 8/26/2008 - Miscellaneous
Theremin-to-Midi program in Pd

For those of you craving a Theremin-to-MIDI controller, here's a free program you can run in Pd to do just that! Percussionist and music/technology blogger Charles Martin created this app in order to use his theremin as a controller for effects. It makes use of the "fiddler" object in Pd for pitch to MIDI conversion.

One thing that stands out immediately to me is the 0-127 (7 bit) control accuracy. Other Theremin to MIDI devices (e.g. the Moog Ethervox) output a 14-bit high resolution signal. Of course, it can be challenging to find a MIDI device that will actually support 14-bit signals for controls like pitch bend. In my experience, however, it's practically necessary when using a theremin as a pitch controller. With 7 bit resolution, you'd hear "chops" between the jumps in the pitch signal depending on how far you're bending it.

I've never used Pd myself, and I'm curious to hear how likely you would be to use a tool like this in a performance? Obviously you'd have to have a laptop connected to your theremin rig somehow - is that too much to deal with in a typical performance?

Read: Theremin to MIDI Control program in Pd (Charles Martin Percussionist Blog) via CreateDigitalMusic

4 Comments

GordonC
GordonC 8/26/2008 6:55 PM
It looks rather a simplistic approach to me. The core of it - fiddle~ returns pitch as a floating point number, which it quantises into semitones. No vibrato, no pitch bend. Volume likewise. fiddle~ also detects attacks, which this code ignores.

This is an air-harp - about as much use as a keyboard that you can only play by running your finger up and down it. (Well, unless you are a MIDI expert and going to do something awfully clever with the MIDI data. I don't think there's many thereminists who are also MIDI mavens.)

Using fiddle on a theremin is probably computational overkill. I doubt you need more than a zero-crossing counter to determine a theremin's pitch.

Can one perform live with this? Spacedog (Sarah Angliss) and Wilco Botermans spring to mind as two examples of thereminists who use Max/MSP (the commercial code-interchangeable equivalent of Pd) on a macbook in their live performances - for much more interesting things than an air harp.

peterkirn
peterkirn 8/27/2008 12:22 AM
I think you're misunderstanding the intent here. This is just something he whipped up for a specific task, though it could be the basis for other stuff. He was just using it as a control change source. So the point isn't pitch bend ... well, for that, you have the actual Theremin. The idea is to control something else, for which 0-127 is fine (and usually about it); he used an effect in Ableton Live.

Pd is more than capable of sending 14-bit signals.

Also, it's possible to interpolate 7-bit / non audio-rate signals if you're hearing stepping even without the 14-bit signal -- provided you don't need the extra accuracy.

As for rigging it all up, you just need an audio interface and cables. But I can see that being overkill if you didn't need the computer itself.
FredM
FredM 8/27/2008 1:52 AM
[i]"One thing that stands out immediately to me is the 0-127 (7 bit) control accuracy."[/i]

How many bits one needs entirely depends on the range one wants to cover..

Good synthesis will give a 1 cent (1/100th of a semitone) resolution, and an acceptable step is probably about 5 cents .. anything worse than 10 cents definately becomes noticable.

So with 7 bits, one might just get away with a one octave 'bend'.

14 bits gives 16384 steps.. 10 octaves = 120 notes, 16384/120 = 136 .. it can be seen that 14 bits gives better than 1 cent resolution over the full 10 octave musical range.

So, for 1 cent resolution, the following ranges are availabe:

bits--decimal--#semitones--#octaves
7-------128-------1.28
8-------256-------2.56
9-------512-------5.12
10-----1024------10.24
11-----2048------20.48--------1.7
12-----4096------40.96--------3.4
13-----8192------81.92--------6.8
14----16384-----163.84-------13.6

You can mess about with the above, multiply #semitones by 10, for example, and you will get the coverage if you only want a resolution of 10 cent (1/10th of a semitone).


[i]Using fiddle on a theremin is probably computational overkill. I doubt you need more than a zero-crossing counter to determine a theremin's pitch.[/i]

I do not know Pd - but I can say that (alas) far more than zero-crossing is usually required to determine pitch.. Even after heavily filtering an input signal, harmonics can cause spurious counting / firing at the zero-crossing.. one needs a more complex analysis, even for the simplest pitch-to-voltage or pitch-to-midi converter.. The whole business of pitch detection looks too easy, and products have been designed which have never made it to market, or been dogged by operational difficulty, because the true complexity of the task is rarely seen in advance.. Arp (Moogs major competitor) was sunk by this one mistake!
ether-jean
ether-jean 2/28/2009 12:21 PM
interesting stuff...

Midi is a limited language even with 14bits.

Maybe the same patch with OSC (Open sound control)can do the job more efficiently.
Osc offer 32 bits and no latency

What do you think of that ?

Sorry, you must be logged in to leave a comment. Please log in or register for an account.