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

Posted: 6/10/2014 3:13:13 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Hi Fred,

Your take has a lot of merit.  Mine doesn't make much sense (even to me!) if I don't factor in the pedagogical opportunity to understand serial processing better, and the chance to address a general need for more complex functionality than dedicated FPGA logical constructs normally provide (state machines and cascaded modules can only do so much before they too become unwieldy).  But it's kind of betting the farm, and one could do as much or likely much more (reverb and other delay effects) with a Beaglebone black lashed to a some circuitry.  A lot of it I suppose is the pent up frustration of working for others for so long, doing stuff I didn't care about that much, while my own ideas languished.  Making up for lost time with a vengeance!

If very little of the FPGA is being used, it could easily give you a tuner, or do linearization, or handle less critical axes directly.  That's what I was doing at first and it was working great before I got so seriously sidetracked.

I think a lot of what we may both be fighting is there is no clear programmable platform that will support 100% of the functions we need, but a few are tantalizingly close.  If I had a Cyclone board with a 16 bit stereo DAC as standard equipment I'd likely have more to show-and-tell at this point (big talk!).  Instead I'm off chasing wild geese.  Another thing I know I'm up against is the entirely adequate products Moog made, and the huge difficulty of bringing anything at all to market in the first place.

But what's super great is, due to the very open collaboration here (and elsewhere on the web) I think we all have a much better sense of what makes a Theremin good, and we have various practical approaches we can put in place to achieve that goal.

Eric

Posted: 6/10/2014 8:55:40 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

Hello Eric, I empathize absolutely with what you say!

"Your take has a lot of merit.  Mine doesn't make much sense (even to me!) if I don't factor in the pedagogical opportunity to understand serial processing better, and the chance to address a general need for more complex functionality than dedicated FPGA logical constructs normally provide " - Dewster

LOL ;-) .. I think this may be the cruncher for both of us.. Certainly, for me, I have been distracted continuously into areas where "the pent up frustration of working for others for so long, doing stuff I didn't care about that much, while my own ideas languished" and the opportunity to (almost) justify playing with / exploring these ideas became (and still is ;-) overpowering.

"But what's super great is, due to the very open collaboration here (and elsewhere on the web) I think we all have a much better sense of what makes a Theremin good, and we have various practical approaches we can put in place to achieve that goal."

Oh yes! There are a whole load of things I have learned from TW and research prompted by postings here - not just about theremins - In fact, the routes I have been steered down have often been highly surprising!

As for "achieve that goal" I think we have actually got to the technical level where we "are there" - There is enough information about what is needed / wanted, and numerous achievable designs and topologies - "we" (and I am talking about the numerous developers - those who go public and those who work "under wraps) could probably have a few theremins on the market with comparable merits which would be superior to any theremin "out there" at present..

Whats delaying this? - Probably the fact that most (all?) of us haven't controlled the urge for continual "improvement" - and the next step involves stuff inventors usually dont like and are incompetent at - manufacture, marketing, obtaining money / investment.. And change - The day one puts product to market, unless one has a competent team and are left to carry on doing what you really want to do, life changes.

Fred.

Posted: 6/12/2014 1:18:55 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Whats delaying this?...the next step involves stuff inventors usually dont like and are incompetent at - manufacture, marketing, obtaining money / investment..."  - FredM

It's probably best done at a cottage industry level - the monetary gains will likely be tiny, so the potential losses need to be strictly minimized.

"...And change - The day one puts product to market, unless one has a competent team and are left to carry on doing what you really want to do, life changes."

This is what's holding me back.  I want to do one model and make it count, and not keep one or more dogs on life support for the rest of my days (bumper sticker: Ask me about time-wasting, lame-ass products!).

Posted: 6/12/2014 1:34:30 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

SystemVerilog is sweet!  I missed the packages from VHDL, where one could stick all the constants, port widths, data types, aliases, functions, etc. for the project and not worry about all the guarded include file nonsense (ifndef, blah blah.).

The two papers I've found the most useful for learning verilog & SV were authored by the amazing Stuart Sutherland.  Here are a bunch of his papers:

http://www.sutherland-hdl.com/papers.php

This one is great for SV if you already know verilog:

http://www.sutherland-hdl.com/papers/2013-SNUG-SV_Synthesizable-SystemVerilog_paper.pdf

And this is a very nice verilog reference:

http://sutherland-hdl.com/online_verilog_ref_guide/verilog_2001_ref_guide.pdf

I'd avoid VHDL, it's too verbose.  verilog is more C like, so most programmers should be at least vaguely familiar with the syntax.  To learn it: look at a bunch of good code and write some of your own.  I haven't found any good books on how real men do real digital design.  I'm OK at it now, but only after nude Jello wrestling with the bear for over a decade, inspecting good code (tough because there is very little of it, even behind enemy lines), and picking up random tips extremely occasionally here and there.  HDLers are a tiny lot, which is weird because the entire world has been undergoing this massive digital revolution for like forever.

Posted: 6/12/2014 7:14:55 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

"This is what's holding me back.  I want to do one model and make it count, and not keep one or more dogs on life support for the rest of my days (bumper sticker: Ask me about time-wasting, lame-ass products!). " - Dewster

Quite ironic really - those who dont give a shi* about their responsibility to support products they sell, are the ones who generally get to production quickly, and the ones who produce crap.. Those who take their responsibility seriously will craft the product to near perfection and try to avoid all possibility of a heavy maintenance overhead - and get to market late if at all...

= more lame-ass products on the market.

Fred.

Posted: 6/13/2014 10:32:25 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Hive - now in SystemVerilog!

http://www.mediafire.com/download/zry439dg14rz6ab/HIVE_2014-06-13_v05.04.zip

Not a lot of change to the casual eye, but I'm really digging SV.  The verilog "reg" and "wire" base types have been replaced with the single SV "logic" type - no more fiddling around with variable nonsense.  SV packages pulled all the magic numbers, user types, defines, and functions together into one file.  And the wildcard port connect and checks are really nice.  And finally an enumerated type so state machines are a bit easier to write, and opcode encode / decode is more straightforward.

Posted: 6/18/2014 12:05:23 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Looking at Excel sims again today, trying to get back into the Theremin groove.  Playing around with things to see if linearity adjustment is even necessary with the "offset, period measuring, non-nulling heterodyning" method.  The offset value can be manipulated, as well as the minimum heterodyned frequency, which can morph things around a lot.  For certain cases though it seems a small amount of linearization might be desirable.  I imagine a lot of it depends on the basic stability of the LC oscillator, if things are shifting around a lot with grounding, temperature, etc. then finer tuning adjustments are likely moot.

I'm not a trombone player, but was thinking today there are probably a lot of parallels in terms of playing the Theremin.

The slide itself only gives a range of 7 semitones, which is not exactly a ton.  As with other brass, tightening of the lips gives access to the higher registers. 

I wonder if anyone here has ever played a somewhat linear seeming Theremin with maybe 2 octaves total range over most of a meter?  It seems most of the movie clips on-line show instruments that are ultra sensitive when compared to the likes of a trombone.  I've read that Clara's was somewhat less sensitive than most.

For myself, if/when I undertake actually learning the Theremin, I imagine I'll dial back the sensitivity quite a bit and use the controls to more or less fit the response to the range of the song I'm attempting.

Posted: 6/18/2014 6:57:27 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

"For myself, if/when I undertake actually learning the Theremin, I imagine I'll dial back the sensitivity quite a bit and use the controls to more or less fit the response to the range of the song I'm attempting."

Hi Dewster,

I think you are right - linearity only becomes really important when one tries to cram "too many" octaves into the field - there is a natural exponential relationship on acoustic instruments, and this isn't bothersome to musicians - but if one wanted to span 5 octaves on a single string for example, it probably could become bothersome!

If on regards the theremin playing area as an "unvisual string" (as Lydia Kavina often calls it) then register switching seems like the best / only way to encompass a larger range - perhaps with a maximum 3 octaves per register - unless one does some electronic "trickery" to linearize the response.

Sadly, "dial back the sensitivity" is not an option on most (if any) analogue theremins presently on the market (designs employing a voltage-outputting front-end driving a separate voicing, such as the 91 series, are best suited to exploits like this) - But would be available on true digital theremins where the front-end is detached from the voice.

And the ability to have independent control over sensitivity and register could well make the requirement for linearization far less critical IMO... If the player was happy with perhaps 3 octaves in the 'field' at any given time.

This is surely where acoustic strings are superior - one can have several side by side, tuned to different intervals / registers, each having usable non-linearity - and apart from the fact that one can play them together, even if played solo they encompass a larger range..

Fred.

Posted: 6/19/2014 1:09:02 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Hi Fred,

It's my feeling that cramped pitch fields may be contributing to an eventual second historical dustbining of the Theremin.  I could be wrong, but spacing the notes more widely seems like it might allow for more acceptable sounding casual playing without learning elaborate fingering techniques, particularly if a tuning display were present.  This is my hope anyway.  I suppose I'm starting to sound like the original Theremin promo materials ("The instrument anyone can play!")

Spent the day sketching out the new flow graph, playing with simulations, and reading papers (mine would would make for a pretty boring episode of "This Is Your Life").  Other than looking pretty damn linear in simulation (if tweaked right), measuring the period (rather than the frequency) of the offset heterodyne has the added advantage of producing a varying rate output that, when coupled to a digital filter, produces a variable cutoff that is directionally correct with fading SNR in the far field.  For example, if the traditional null point is offset 50kHz or so (so that the minimum heterodyned frequency is 50kHz, with  increasing heterodyned frequency as the hand approaches the antenna) then, for lower frequencies, measuring the resulting period gives a longer interval between clocks before producing the next measurement.  As each measurement comes in it is fed to a low pass filter, clocking it.  In this way the filter runs at a lower rate when the hand is far from the antenna, and at a higher rate when the hand is nearer, and cutoff is directly proportional to rate in a digital filter.  So one might set the cutoff of the filter to be 200Hz or so in the far field, with this automatically going to 2kHz or so with the hand near the antenna, giving 1kHz or so BW in the mid-field, where it seems god intends for us to play.

It also looks like the period measurement method (if tweaked right) produces pitch numbers that start pooping out when the hand is a very small distance from the antenna, like an inch or so, which seems to be better behaved than the cramping up one experiences with a standard Theremin.

The thing I'm wresting with now is how to get this variable rate output back to a fixed rate to be sampled by the processor.  It obviously involves LPF  to minimize aliasing and the throwing away of samples (decimation).  I'd like to do as much of it in the processor just to keep things flexible, and to reserve as much logic for other axes, displays, etc.

Posted: 6/19/2014 11:26:02 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 thing I'm wresting with now is how to get this variable rate output back to a fixed rate to be sampled by the processor. " - Dewster

Do you really need to?

Ok - for standard digital (wavetable etc) output, you do.. But with an FPGA couldnt you just pipe the output to a hardware mixed signal configuration (like my square/triangle/ramp mixer which only needs two square wave inputs [one reference, one variable] and uses a few bits of logic, and outputs PWM for these waveforms..

Yeah, I know this is real limiting compared to what one can do in the digital domain - but it might (?) be a quick way to get audio out at least in the early stages, to allow you to test linearity etc.

When you talk about the auto-tracking filter, this sounds really neat - I am assuming this filter has nothing to do with audio - its purely related to the antenna response.

"It's my feeling that cramped pitch fields may be contributing to an eventual second historical dustbining of the Theremin. "

Not sure I understand this, or if I do, that I agree ;-) I have come to think that the theremin has no hope of ever being a "mainstream" instrument, that even if perfectly linear and reasonably playable, it is only novelty that keeps it "alive" - my thinking is on these lines - Anyone who has the potential to play an instrument like the theremin (or trombone or violin) must have a good ear for pitch - and the vast majority of people with such ability will find other instruments (with a tactile interface) far more satisfying.

The theremin only serves those who want its specific attributes and devote themselves to mastering these, and it also serves the musically clueless - this latter class wouldn't know the difference between a theremin with an exponential linear or log response!

I dont see the theremin going into "the dustbin" - but likewise, I dont see it ever really going "anywhere" - I think it will retain its obscure novelty niche - at least until it perhaps gets trashed as a result of some impulsive fad caused by crowds of unmusical people buying Theremini and flooding you tube with crap.. But somehow, I dont think even this will "kill" it - 50 years from now there will probably be some form of TW and some people still believing the instrument has a future. I think it has a future - but will always be an obscure teeny part of the musical instrument 'spectrum' and a far more (but still tiny) part of the toy / novelty / student project / novelty / educational "spectrum".

Fred.

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