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

Posted: 2/20/2013 7:56:54 AM
FredM

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

"The digital approach has a lot of rigamarole up front, but after that it's so much easier.  Nulling is a snap, sensitivity and operating point are abstracted somewhat away from the vagaries of the analog front end, and linearity can (hopefully) be improved using simple math." - Dewster

I think you are right, Dewster.

Looking at the FPGA potential, I still think it is "tight" in terms of resolving the capacitance changes with enough resolution that fussy ears cant detect any steps - but probably not impossible..

And as you say, once you have this "capacitive distance" in digital form, you have the power to manipulate this data in ways which are complex and difficult to achieve with analogue - perhaps even impossible to achieve in analogue if one has a composite system which also produces the tone.

For me, splitting the detection from the sound production, is a way to make life easier - I am doing this with analogue computation on my advanced designs - converting capacitance to a voltage, and manipulating this voltage to perform linearization.. But there are big challenges - and some things which are a pain in the backside.. for example the exponental functions which are based on transistor charactaristics, and require thermal ovening.

The tone generation is a challenge all of its own - and here I think analogue beats digital hands down - But, if your digital theremin was able to produce a control voltage output, then analogue tone generation could be implemented (it could interface to my true analogue heterodyning voltage controlled theremin modules , LOL ;-)

From a pragmatic perspective, I think you are on the right track and I have gone up a lonely alley - Most people really dont care what their theremin sounds like - or even know what it sounds like, LOL ;-) ... They love their theremin and they think it sounds sweet and that they can play it in tune, and if Uncle Howie says that an Enkelaar sounds like a RCA, then it sounds like a RCA!

As long as you dont tell anyone that your theremin is digital, people will love it! - So encapsulate the FPGA board in epoxy, but make the coils big and visible.. Then sell it as a "true Pro theremin" - Bob got away with selling the E-Pro and its "heterodyning" is done in a cheap CMOS exclusive Or gate.. He had the good sense not to tell anyone.. ;-)

Some people noticed that something was "wrong" - But most people love the instrument and its sound.. And thats all that matters - what the MAJORITY of purchasers and users think.

Fred.

 

Posted: 2/20/2013 10:48:13 AM
Thierry

From: Colmar, France

Joined: 12/31/2007

" Is there any Theremin out there that has a coupling control? " - Dewster

Yes! The Moog Etherwave Pro!

An attenuated signal from the variable pitch oscillator (through a resistor divider) goes through 2 parallel 1/2 LM13700 (inputs, outputs and Iabc all respectively connected together in parallel) as  VCA and is fed back into the fixed oscillator. The small "pitch response" potentiometer on the bottom of the front panel allows to set the attenuation rate of the VCA. The more you turn it clockwise, the less coupling is provided, thus the more the lowest octave is stretched.

Posted: 2/20/2013 11:07:24 AM
FredM

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

"Yes! The Moog Etherwave Pro!" - Thierry

Thanks for that information Thierry,

I think one of us (and I am not sure who ;-) has misunderstood Dewsters question,

I understood that he was talking about "coupling" in terms of coupling (mixing) the theremins audio output (post VCA) with the preview (Pre-VCA) so that the thereminist could have headphones and listen to a mix of pre and post VCA audio.. (my reason for thinking this probably because Dewster is working with digital topology - Oscillator coupling is much more an analogue function - As Dewsters design does not even have a physical reference oscillator, it seems unlikely to me that "coupling" was related to oscillators)

You are talking I think about variable oscillator coupling (?) to the fixed oscillator to provide a degree of pulling /synchronisation / locking of these oscillators.

It is not only the E-Pro which alows adjustable oscillator coupling, but I am interested that the E-Pro does this through such a sophisticated method - the most sophisticated that I have seen has used a reverse biased diode (Varicap) to implement DC controlled coupling.

Fred.

Posted: 2/20/2013 3:32:42 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Thanks Fred and Thierry!

My brief analog foray yesterday is what prompted the product idea.  I was thinking the coupling between the fixed and pitch oscillators might be a nice fundamental variable control to have on the front panel of an analog Theremin as it influences bass timbre and linearity.  Fascinating that the E-PRO has this!  With a bit more control over the innards, good sensitivity, and good linearity, I'd think a pitch only analog Theremin could be sold for $150 to $200 USD.  IMO it's the pitch side that most fascinates people.  You could sell a separate volume module for those who want to mix and match / have more control over the effects loop.

Posted: 2/20/2013 5:29:23 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I bet if you ask theremin players, many are after their own individual sound and once set they are unlikely to change it."  - RS Theremin

Not a player myself but I imagine that's largely true.  Those panel pots that have a screwdriver adjustment rather than a shaft and knob might help in this situation, so that once you have the sound it won't get accidentally disturbed (the E-Pro has two of these).  Or better yet, presets in a digital Theremin!

Posted: 2/21/2013 1:33:48 AM
FredM

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

"Or better yet, presets in a digital Theremin!" - Dewster

Best of both worlds.. digitally controlled potentiometers in an analogue theremin! ;-)

Alas, one needs a way to adjust these pots - which means a digital user interface - and display - and menu / parameter / preset selection system, and rotary encoder, and buttons, and non-vol storage component (least of the problems)..

... And once ones added all that, it seems a bit wasteful to only use it for adjusting a few pots...

Fred.

Posted: 3/2/2013 2:26:55 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Yesterday I ordered an Altera Cyclone 2 board off eBay for ~$21USD which included postage.  An earlier build of my verilog S44 processor compiled in the Altera Quartus 2 tool and appears to consume about 1/2 of the fabric, which is roughly equivalent to the Xilinx Spartan 3 demo board I'm currently using.  But there are fewer block RAM resources in the Cyclone and this may hurt me if I try to implement wavetables.

For somewhat less than double the price of ~$35USD (including shipping) I see that there is a Xilinx Spartan 3E board available that is highly similar to the Spartan 3 device on the demo board I'm currently using, which has double the block ram of the Cyclone 2 board I ordered.  And for the same price there is also an Altera Cyclone 4 demo board which also has double the block RAM plus ~50% more fabric.  These two boards look almost identical, and have a better form factor than the one I ordered because the header pins are installed pointing down rather than up.

Cyclone 4 board.

Spartan 3E board.

What would kill would be one of these boards with a bit of user Flash and stereo 16 bit DAC installed.

Revisiting the processor, thinking of expanding the multiply to 32 x 32 = 64 bits since the multipliers are just sitting there in the fabric and it would only consume a third of them, but doing this with a two clock pipeline slows the entire design down somewhat so I'm tinkering with the logic to see if I can get it any faster.  24 x 24 would be OK for audio I suppose but it's not as pretty.  In a few years the wider multipliers in the higher end FPGAs will probably trickle down to the lowest end.

[EDIT] Maybe a 24 x 16 or 32 x 16 multiplier would do.

Posted: 3/2/2013 3:51:24 PM
FredM

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,

"thinking of expanding the multiply to 32 x 32 = 64 bits "..

Why do you need this resolution? - Presumably for pitch computation and the like more than anything else?

Also, not sure what data type you are working with .. 32 bit manipulations tend to hog cycles im ALU type operations..

Forgive me as I am probably missing a lot by thinking in terms of sequential MCU type operations rather than in terms of FPGA logic - But to me 16 bit x 16 bit covers the requirements in terms of pitch steps (<< 1 cent) so I dont see why anything more than a 32 bit result could ever be required... 24 x 16 certainly seems massive to me!

Fred. 

Posted: 3/2/2013 7:22:30 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Why do you need this resolution?"  - FredM

It's kind of a slow processor (~100MIPS) so I'm looking to add any reasonable functionality that might reduce calculation steps without bloating it out.  Filter coefficients are often wider than 16 bits, the recursive parts of filters use double precision, and the pitch values coming from the DPLL are wider than 16 bits.  Double precision multiply is kind of painful in code when you only have 16 x 16, and there are plenty of multipliers in the fabric that could step up to the plate (signed & unsigned 32 x 32 only takes a total of four 18 x 18 multipliers plus two adders).  Kind of like why I pipelined the S44 processor, the fabric logic has several flops at the output of each LUT, and a predominantly asynchronous design bypasses and largely strands this valuable resource.

A 16 x 32 multiplier perhaps makes the most sense, this only consumes 2 hardware multipliers and runs at ~133MHz (two manual pipe stages) in the target device.  32 x 32 via the wizard gives 116MHz but I need 33 x 33 signed to get 32 x 32 signed or unsigned and the wizard in my old Quartus 2 tool doesn't have this option (unfortunately you have to use the wizard to get automated pipelining).

My goal for the processor is to have something powerful enough to be useful, but be simple enough for human programming at the lowest level.  It should also fit in the smallest FPGA with sufficient room left over for peripherals and other unrelated stuff.  Last week I looked at better utilizing the op-code space by having a variety 1, 2, and 3 operand instructions, but it made it quite a bit less mentally tractable.

Posted: 3/2/2013 7:50:42 PM
FredM

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

Ok, sorry I asked! ;-) ... I have enough trouble using the one hardware multiplier in the PSoC 1 usefully!  .... Getting my head 'round the multiple ALUs and multipliers etc in the new PSoCs causes my head to swim... And as for filter coefficients in FPGA's... Well - Remember - Im one of those luddites who still "codes" FPGA's using schematic entry, LOL ;-)

Way above my head you goes! .. But please dont "dumb down" - Even if you did, I would still be lost.... And this way I can just save what you write for reading when and/or if I make the effort to study the required "background" to fully understand what you are saying.

Fred.

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