Let's Design and Build a (mostly) Digital Theremin!

Posted: 5/16/2014 1:16:56 PM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007


At risk of hijacking this thread (although, with this thread, that's quite difficult ;-) I think what you say above is probably "right" - But only "right" if you are addressing a "conservatory" for those aspiring to "professional" classical theremin playing... I think there are some at TW for whom this is such a "conservatory", and others for who its not... Just as for some TW is a theremin design lab, and for others its not! ;-)

The vast majority of all electronic (and probably also acoustic) instruments are not played by classical or "professional" people, or people who aspire to this - they are played by people who primarily want to derive personal pleasure from playing.

In this regard, perhaps the main difference is that, unlike with other musical instruments, theremin owners  somehow seem more likely to be delusional - They seem to think they can play, and / or play well, and will "publish" their noises for any masochist to "enjoy".

So it is dawning on me that perhaps toys like the Theremini are a good idea - those aspiring to "real" (particularly classical)  playing will either avoid these toys or find them useless and re-sell them - these toys, in the hands of musicians using them as sound effects or for "non standard" music could find they do what is wanted, and are not "toys"... And those just after musical fun will probably be happy. There are a huge number of "toy" synthesizers out there making horrible "music" but pleasing their owners and giving them "musical" outlet - and sometimes, in the hands of a creative musician, producing wonderful musical masterpieces.

If we let go of our "reverence" of the theremin concept, and just accept that this is the way things are, perhaps it will all be ok... We can still engineer beautiful new "real" theremins for those who want them - Our "club" wont be impacted much - lets face it - it doesnt need a Theremini to drag the thermin into the "disrepute" people are quite able to do that even with an E-Pro!

Also, it is possible that the Theremini, if it becomes popular, could expand the market - It may be that people will want "real" theremins as a result of dissatisfaction with their toy - that, as a result of buying a low cost toy they will become exposed to theremin music played on great instruments by great players, and this will lead to something ..

Who knows..


Posted: 5/16/2014 1:47:55 PM

From: In between the Pitch and Volume hand ~ New England

Joined: 12/17/2010

Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~

I may have not studied music for 5 years and I do not know how to read music ~ but one thing I can do that many others are not doing (and have gone to music school and know how to read notation ) is composing music with the tools I have and incorporate the theremin into the music I create.

I may not have a diploma from the most prestigious music school on the wall, but my imagination is full of sweet ideas ~ I dedicate a lot of my time to play this instrument well and strive for bettering myself each time that I play it. I consider myself a professional vocalist and musician even though I have a full time job and do this part time. All of my 4 albums are on Pandora and have gone through extensive selection/examination processes. I must be doing something ok!

Hopefully, I can put the theremin into the light and make a good impression on old and new listeners of the instrument. :)

Posted: 5/16/2014 5:01:10 PM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ Hijack ~ AND OT / OTT !


I believe there is a natural tendency for people to try to 'elevate themselves' - Its part of our core delusion - the delusion of "fairness" and that we "reap what we sow" ! ;-) Someone who has spent many years studying and grafting, who can read music, and who has a diploma hanging on their wall, is more likely to have some sense of injustice when an "upstart" comes along and, (as far as they can see) without going the conventional route or apparently doing the 'work' they perform better than the diploma owners..

People who invest expect return - but worse, many have a fixed idea about the "form" such investment should take, and often fail to recognize that the "upstarts" have often invested as much, if not more - but the form of this investment is not as obvious as a diploma... It sometimes (even if they wont admit it to themselves) seems unfair - and possibly sometimes triggers a delusory "protection" mechanism which prevents them from hearing how good the "upstart" really is!

We all "suffer" from this malady - Imagine if "walk off the earth" had actually been playing a theremin and not faking it - Imagine how you would be feeling about someone picking up a theremin and mastering it before they even plugged it in! ;-) ...


As you will know by now, I think the whole of life is one mass of interwoven delusions and nonsense - but we cannot live without participating in these.. Or at least I haven't found a way to ;-)

And within these delusions you have a wonderful and important role IMO - You give hope and inspiration  to those who cannot read music or afford to take years to study music.. Apart from which you create wonderful music.



*some "upstarts" may have made little investment - they are just born with "gifts" others haven't "received" - it aint "fair" - it aint fair that some are born into poverty and others with a silver spoon in their mouth, or that (perhaps) some are born with perfect pitch and musical ability, and others are born deaf...

IMO There aint no "justice", only cause and effect running since the instant time began - there's no freedom, only a 'script' we all follow, mostly unknowingly -

But we want to believe that we are responsible for where we are - that we have "earned" it - that we have the "right" to claim our "status" or "wealth" - and that we have the right to scorn those who haven't "made the effort" we have - these are, I believe, the motivational ideas which have driven humanity and been responsible for our dominant position over other life on this planet, the ideas on which our entire social (whether capitalist or communist, secular or religious) order is based.. - but this doesn't change the (IMO) fact that all these ideas are entirely false and entirely delusory.

On the flip-side, when our lives go pear-shaped, we NEED to find reasons that "make sense" - making "sense" and finding "order" is intrinsic to what we are.. So we look for our "mistakes" (a useful process we have evolved which applies modification to our causal matrix) or for someone / something to "blame" and invent these if we cannot find them, create unseen entities, demons or angels or whatever if we must - Anything to escape from the truth that there is no real "blame" - and that everything probably comes down to "luck" or lack thereof :-(

Posted: 5/16/2014 9:53:00 PM

From: Northern NJ, USA

Joined: 2/17/2012

Not trying to pick on anyone, but generally with music (as with most things technical / creative) my feeling is the more the merrier - as long as no one is forcing me to listen to anything against my will (a condition not always met, particularly in the shops around the holidays).  Everyone has to start somewhere, and lay interests are often at the root of more professional endeavors.  Though "professionalism" as in "making money" can't be 100% of the reason why anyone does anything, and when present the money angle is often a confounding element.

I'm not sure how I feel about tons of training when it comes to music.  For instance, some vocal training seems good, but too much can sometimes channel one down operatic paths, which to me is kind of artificial sounding in this day of PAs.  For orchestral instruments, training is necessary to communicate and play cohesively in traditional groups, but should this then be the goal for all musicians?  The guitar seems strongly embraced in part for its iconoclastic, break-away status.  Too much expectation can lead to too much formality and rigidity, which can kill all the enjoyment of doing it in the first place.

Anyway, the Theremin will continue to exist and be played IMO largely because of the curiosity factor.  There's really nothing else like it.  Though I do wonder how easily it wears out its welcome with the general public.

Posted: 5/16/2014 10:14:56 PM

From: Northern NJ, USA

Joined: 2/17/2012

Been spending more time here and there on Hive.  I decided to make the local register set access 32 bits wide to accommodate the bolting on of co-processors at this interface.  But mainly I felt the vectoring (clear & interrupt) mechanisms were too simplistic and in some ways dangerous:

1. Clear and interrupt inputs were external only.  Internal interrupts could be quite useful in a multi-threaded core to reduce the need for and wast of real-time involved with polling type handshakes.

2. Interrupt arm / disarm was manual and via simple register bits (e.g. write a 1 to bit 0 to arm, write a 0 to bit 0 to disarm) which might not play nice with multiple thread reading and writing (this needs some kind of non-interfering or atomic read-modify-write mechanism in order to avoid faults).

3. Multiple closely spaced interrupts could lead to return stack overflow faults.

So I made the interrupts automatically disarm during their execution, and added an explicit return opcode (op_rtn) to automatically rearm them.  In the case of a return getting "lost" and producing deadlock: issuing an extra return is an OK thing to do, and manually disarming and then rearming the interrupt also clears the auto disarm state.  In the case of an interrupt getting "lost" during the disarm period: if this is an issue then one needs to design and implement extra hardware (this is a "philosophy" thing - I think responding to interrupts in a timely manner is generally more important than missing an interrupt while servicing the current interrupt, but of course it all depends on the application).

The interrupts and clears can now be issued via writes to register bits, and the interrupt arm/disarm is via "radio" bits in the same register (e.g. write a 1 to bit 8 to arm, write a 1 to bit 0 to disarm, writing a 0 has no effect) so multiple thread access to this register should be safe.

I rewrote much of the code to be more straightforward to read, and this has enabled it to now pass through the Xilinx ISE toolset without error, which is nice.  (One should probably pass one's code through as many compilers as possible in order to "de-lint" it.)  Though I will almost certainly stick with Altera devices as they are less expensive and faster, and the older Altera tool has a very nice simulator which I rely on perhaps too much, but there are no real alternatives out there.

Posted: 5/16/2014 11:45:23 PM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Hi Dewster,

I am not really into opera, and shared your thoughts about " kind of artificial sounding in this day of PAs" - But I recently (while exploring vocal formants) discovered reference to an alleged effect which surprised me - I have never knowingly heard this, but if true it astounds me..

Apparently, some operatic singers can 'open' their their vocal tracks and act to 'vocode' the sound the orchestra is producing - this is done by lowering the larynx (as in, producing less or no excitation from their vocal chords) and widening their pharynx - singers are advised to pretend they have an apple stuck in their throat, and can apparently get the area of the pharynx to 6* the area of the larynx tube..

No db's or scale of any kind was given in the text (I do not know how loud the formants are other than with respect to unknown "straight orchestra" levels - or even if the plot is db's or linear) - But it could be that PA alone is not able to achieve the same "ringing" effect that an operatic singer can.

In fact, the more I look into formants and other acoustic resonances, and listen to simulations, the more inclined I am to believing that these hold the key to many 'mysteries' - including mysteries about tube sound and classic theremin sound.

I am inclined to think that with a fast processor like your "hive", digital formant filters with (possibly) dynamically changing coeficients could really capture all the 'analogue' and 'acoustic' qualities of the classics - I am only using 3 fixed (but manually adjustable) formants, but have two of these filters, one driven from a tunable LPF and one from a tunable HPF - The result is that the formants 'morph' into each other in a frequency dependent way - I think better results would be obtainable by just having 3 formants with each referencing a coefficient LUT indexed by the fundamental frequency... One formant filter with 3 fixed (but manually adjustable) formants is probably even enough to emulate the response of present classic theremins..

If the formants were changing dynamically, then adding an input for external audio might enable emulation of the 'operatic' "vocoding" effect.. (and also be useful perhaps for other effects - feed noise in to play wind / rain etc, or for other "VCF type effects) But doing this with analogue circuitry involves such complexity as to be unrealistic.. unless one goes over to voltage control (and even then, to craft changing coefficients  one would need an array of user adjustable potentiometers, almost an analogue 'sequencer', or to have a digital subsystem -involving ADC-  which indexed a LUT and output to the analogue via DAC ) -

At present I am looking at the simpler analogue 'morphing'  route (or just adjustable but unchanging formants) which allows theremin audio alone to drive the formant processing, so it can be added to existing theremins without requiring their modification - I am not at this time working on a full theremin.. But building this filtering into a theremin would actually be easier as one can play with the mixer and implement a lot of this stuff more simply than having to work with audio of changing amplitude.. but even with thus, digital filtering should be a lot easier and probably better.


Posted: 5/26/2014 11:46:51 PM

From: Northern NJ, USA

Joined: 2/17/2012

Hi Fred,

Interesting the "vocoding" effect, could you point to the reference?

While looking for it I came across this:

http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2757425/ ("Modeling source-filter interaction in belting and high-pitched operatic male singing")

which investigates interaction of the vocal source with the filtering aspects.  When reading it I thought of the parallel tank / series EQ resonant structures of many Theremins: when the resonance coincides with the generated pitch there can be instabilities that the simple decoupled source and filter model doesn't have.  Physical modeling often takes this kind of thing into account.  (I'm also somewhat amused with the use of "belting" as a scientific term. ;-)  Yodeling and the like might hinge on these types of instabilities?

Haven't done 1/10 the research you have Fred, but I'm hopeful that a vocal synthesis approach to the Theremin will yield a broad pallet of sound that is perceived as sufficient by owners / players.  Was thinking of the frequency / amplitude / 3rd controller numbers going into a threshold / gain / offset modulation matrix.  LUTs would be the generic solution but might be too difficult for the average user to set / manipulate, particularly via the front panel?


A couple of weeks ago (before an inexplicable general malaise hit me) I was looking for papers on high stability RC oscillators and ran across these:

http://www.ti.com/lit/an/sloa060/sloa060.pdf ("Sine Wave Oscillator")

http://cds.linear.com/docs/en/application-note/an12fa.pdf ("Circuit Techniques for Clock Sources")

The first mentions the "Barkhausen Criterion" which is something I bring up in this thread a lot but forgot the technical name for it.  (It is presented rather technically in the guise of feedback control theory.)  The second paper has an interesting RC oscillator at the end which combines an opamp and CMOS in an interesting way with Tempco.

The second paper also mentions active device propagation delay as a major reason for temperature dependence, which makes a lot of sense as it contributes to overall phase shift through the loop.  High frequency oscillators should probably use fast devices and / or have some way of largely cancelling / compensating for the delay (e.g. my initial DPLL approach used feedthrough gates in the same CMOS DIP as a reference in an attempt to cancel driver delays).

Posted: 5/27/2014 6:29:11 AM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Hi Dewster,

I hope your mysterious malaise has passed!

Sorry - I wish I could give a reference - its one of those bits of an article I extracted, and never referenced - I will email the bits I have if I can find anymore that what ive posted.

Well waddaya know! I found it!  ->


With regard to device delays, I think this is a major topic for truly HF oscillators (> >> 10MHz) but dont really know if this is major below 1MHz - or at least not major compared to the other huge sources of error inherent in theremins.

I am also starting to think that precision is far less critical / important in analogue designs than in digital ones.. Been playing with some circuits that I would have thrown out in the past, but finding that I cannot hear any difference between them and much more complex designs - when it comes to simulation, one can I think get too pedantic - building the damn things and comparing them, those wonderful spectrum's I spent days crafting on the simulator are quite different when looking at them 'live' - and the crap ones are also different - and even the crap ones sound better live than in simulation, and often sound just as good as the complex designs that gave a perfect spectrum.

To be honest, when it comes to oscillators (and probably theremin development ;-) , I am burned out - The maths involved with them gets beyond me when one starts to look at things like phase noise and delays etc, and mathematicians dont even seen to be able to put a half-decent oscillator together.. You steered me away from parallel tank designs with your lovely CMOS oscillator/s, and I have now developed an oscillator based on a TS555C which seems to perform beautifully, and think I have found a good method for electronically linearizing the response using  separate BPFs and phase comparators which can linearize both the far and near fields independently..

"Haven't done 1/10 the research you have Fred"

LOL ;-) .. Truth is, I think ive done at least 10* the research I should have! - It shifted outside of the domain of "needed" research a long time ago, and became an obsession.

Time to start using it.


I have got horribly distracted.. Been working on oscillators and bits for my ribbon - trying to optimize the design.. There are a load of 'blocks' which are nearly the same function.. Oscillators + HF BPF's driving phase comparators for volume, and for pitch linearity correction - and I decided to build these on a common small PCB each, so that I could have a batch of multi-function boards made...

Then there was that student recently presenting yet another hopeless horrible theremin design he built from some crap circuit found on the wweb.. and I thought, two of these little boards would do everything he needs... They have one TS555C, IF transformer (actually, only a tunable inductor is required) , a few R's and C's, give a good 40V P-P on the antenna for 5V supply, and the mixer can be a simple OR gate directly from the 555 discharge pins wired as Or (also has sine mixing available from spare winding on IFT).. Single transistor buffer (not absolutely needed) and one has a triangle @ 2V P-P and / or a classic diode mixer.

So I have diverted a bit to develop modules that can make a simple one-stick, and be expanded by adding other modules for volume, electronic linearization etc, all the way hopefully up to a register switching (as E-Pro) instrument with better sound  ;-) .. This sort of fits well with the book I am writing.. I intended to include a complete theremin design in it, and refer to this in each appropriate chapter - Having a common circuit for oscillators and BPFs means I only need to explain the circuit operation once! ;-)

I am seriously starting to wonder about what REALLY makes a sound appealing - Been focusing on formants for a long time now, and studied formants of human voice and resonances of classical instruments - I had this reverence, thinking that Lev actually crafted these deliberately into his instruments... I am now shifting to thinking it was probably accidental (or rather, not designed on paper or with a slide rule, but "designed" hands on, exploiting undocumented characteristics of audio transformers and the like)  - that its actually 'randomness' which makes a sound interesting.. That the only reason perhaps why we (some) like the formants from the original instruments is because we 'link' it to a particular player... A bit like recognizing a persons voice.. give that voice to someone else to sing, and it will only satisfy if its sung in the same way as the original 'owner' did..

For a long time I think I missed the bloody obvious - Spent too much time looking at waveforms on recordings rather than looking at spectrums..The Lev theremins waveforms change dramatically as a function of pitch, and I missed the reason for this - I am now nearly sure that the primary reason is (mainly audio frequency) resonances within the instruments electronics.

Perhaps the formant controls shouldn't be on the front panel - perhaps they should be a bunch of presets the owner can access, tune the instrument for "their" voice, and then leave alone - every one could then be unique (in terms of its resonances - still have control over waveforms etc). Every mass produced electronic musical instrument sounds essentially the same - no two acoustic instruments sounds exactly the same, even if mass produced - Perhaps (?) for non-percussive instruments like violins and theremins, a resonant "character" is really important ?

This character doesn't change (much)  on any individual acoustic instrument - A violin with crappy resonances will sound like a crap violin , and those crafted by Stradivarius will sound great, and a lot of what differentiates them is (I think) the placement of the (fixed or only having minor player control over ) formants / resonances of these instruments. Having worked in studios and designed some high-end audio stuff, the instinct is to go for as flat a frequency response as possible, to allow harmonics to be sculpted later - one doesnt go making the response bumpy! - But actually, I think its probably bumps in the "right" places, right in the core instrument, which may be needed!

Posted: 5/28/2014 2:37:11 PM

From: Northern NJ, USA

Joined: 2/17/2012

"I hope your mysterious malaise has passed!" - FredM

Thanks!  TMI: Nothing too weird in the bloodwork.  Iron and B12 brought me back from the precipice of exhaustion (never have vitamins had such a profound effect on me) but still not 100%.  Vegan diets can apparently be dangerous in the wrong hands (and if not inventoried periodically).


Thanks!  Nice paper!  There sure seems to be a lot of basic vocal research out there.

"With regard to device delays, I think this is a major topic for truly HF oscillators (> >> 10MHz) but dont really know if this is major below 1MHz - or at least not major compared to the other huge sources of error inherent in theremins."

It likely depends on the magnitude of the delay with respect to the oscillation period, and how finely one is "measuring" that period.  4000 series CMOS is pretty slow (max prop delays in the 100ns range), and Theremins tend to magnify error via heterodyning and/or operating point subtraction.

"...I have now developed an oscillator based on a TS555C which seems to perform beautifully..."

Ooh, interesting!  Series tank? 

(I was looking at the 555 lately to build an ESR meter around - for that project at least it was too bad they didn't forgo the discharge transistor and instead bring out Q inverted on that pin.  I mean, one can always add a transistor.)

"But actually, I think its probably bumps in the "right" places, right in the core instrument, which may be needed!"

A guitar effect schematic I ran across years ago had a long series of bump-inducing mild filters at the output, I assume to simulate the standing wave effect in the speaker cabinet.

Posted: 5/28/2014 7:27:59 PM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

"Ooh, interesting!  Series tank? "

Yes, - its a dual series capacitor oscillator with a capacitor on either side of the inductor - the capacitor on the drive side has a parallel controllable resistor (H11F1) for tuning -  I will publish it as soon as I know that it really works as well as it simulates - I know it works, but don't have access to anything but my portable MM/Scope right now, so cannot check anything much other than that it works..

Actually, the TS555C is just wired as a schmitt 'comparator' - I can get the same function from a couple of 40106 inverters in series followed by a push-pull (inverting) BJT buffer (the drive from the TS555C is just good enough, Current into the inductor is a sine peaking at +/- 10mA if one wants a healthy antenna voltage - this is due to losses in my electronic tuning circuit that's right on the drive side - the tuning circuit allows about 15kHz adjustment, but there's about  20% change in antenna amplitude over this adjustment span) - The 40106 / BJT version is probably better.

One thing I really like about this oscillator is that it must oscillate - even if its oscillating in 'RC mode' - A bit like strapping a R across an inverting schmitt with the input coupled to ground with a capacitor... With an inductor there and the right drive circuit it seems to be a beautiful oscillator..... But I do need to prove it both theoretically and practically, as simulation may not accurately model delays etc.

I am quite sure though that as a simple beginner 'toy' one-stick, without the tuning circuit (using adjustable antenna) it will fit the bill - I am hoping it will be more -

"It likely depends on the magnitude of the delay with respect to the oscillation period, and how finely one is "measuring" that period. "

Yeah - This is where I get a bit screwed.. I guess it comes down to the way I design and my severe limitation WRT the maths etc.. Taking a swing analogy, I dont really see why delay in the time (instant at which, period and drive etc) the swing is pushed should affect its oscillation period, provided its phase is correct - it certainly affects amplitude, but provided it remains synchronous (as in, just enough energy is being injected somewhere in the right phase to overcome losses) what mechanism would cause frequency change?

I know frequency can be changed through delays - but I confess that I don't have any "feel" for why this happens :-( ... Which is a shame, and something I would like to correct.. My tuning scheme for example - I see it as working by "bypassing" C1 with a variable (RV1+R4)||R3 in the series resonator, thereby changing the Z of the C||R resulting in changing the resonant frequency ( R3 is essential anyway to provide a DC path for the circuit) .. This I understand .. But I never really understood why your C to ground on the drive side of your CMOS oscillator was frequency dependent!


(Circuit below is just an approximate equivalent of actual circuit - IT WILL NOT WORK AS SHOWN! )

C1 = 470p, (RV1+R4)||R3 = ~500R to ~2K, L1= ~500uH to 1mH (tunable), C2= 180pF,

R1 >100k <500k, R2 = ~100R  Frequency (widely tunable with L1) ~ 500kHz

R4 >= 400R, Tuning range RV1 >10kHz (Using H11F1 for R4+ RV1 which has controllable R from 300 to Megs) Range is limited by R3, but this cannot be bigger than about 2k2.

Circuit seems to work with minimal change of frequency or amplitude for resistive loading on antenna (to ground)  down to 100k. R1 is such a loading.

Into a TS555C R1 cannot be bigger than 470k, but lower value (220k) is safer - this is due, I believe, to pin capacitance. (I have protection clamping diodes on this input which also add capacitance - and with the 555 two pins, th and tr are connected together)

 I use a 42IF106 IF transformer for the inductor.

There is a slight DC current flow through L1, but its tiny - this is due to the above 0V hysteresis on the schmitt and the current through R1 being asymmetrical (WRT 0V) as a result.

You must be logged in to post a reply. Please log in or register for a new account.