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

Posted: 3/23/2019 7:47:11 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

NOTE: These are only my opinions, even though my opinions get a little strong at times.  It's just one more perspective.

"Exactly which legacy features are good to retain are a series of judgement calls, unfortunately.  (As an engineer I've developed a rather visceral reaction to legacy and I'm trying my best to keep that at bay! :-)" - Dewster

I think you've done some great things by ignoring legacy for the D-Lev architecture and electronic design.  I think it is riskier to ignore legacy and tradition when it comes to the appearance and feel of musical instruments.

"And user variable note spacing frees the player to use whatever hand / fingering style that works best for them (wider settings enable other minor things like breathing and not having to stand like a statue). Data point of one, but I wouldn't have bothered to learn the Theremin without this feature as it is so central to playablility for me.  Larger note spacing profoundly alters the playing experience in a very fundamental way - it's like going from a mandolin to a classical guitar."

The D-Lev's ability to optimize linearity and octave spacings to individual preferences is a huge deal - I would say it was the biggest selling point if it weren't for the even bigger attraction of its synthesizer section (cello!).  Going from the Etherwave, to the Subscope, and then to the D-lev (with rod/loop), I find that everything just gets easier and more natural with the D-Lev because the nearly perfect linearity allows most music to be played closer to the body with the forearm nearly vertical rather than being extended outward.  Larger note spacing contributes to the playing comfort, although making octave spans larger than you can reach with strictly hand and wrist movements tends to reduce the speed and accuracy of fast jumps.  My standard for setting up maximum octave interval spacing is "When You Wish Upon a Star", because of the fast octave jumps.  At least until Disney sends lawyers over with a Cease and Desist.

"In my mind plates are part of this.  A long thin pitch rod is there on analog Theremins for very good engineering reasons as it helps to linearize the field somewhat.  Once that pressure is removed, can we do better?  And if we can, why not?  I'm sure that there are players who depend, however consciously, on the geometry a thin pitch rod imparts to the near field for their playing style (I'm looking at you Roger! :-).  Nothing personal, but how much should such players be accommodated when the slate is clean?"

Not at all, if you don't mind wiping clean the slate of skilled- and professional-level players and potential customers who understand that a planar pitch field is going to feel different from a cylindrical one, or who simply prefer a more traditional-looking instrument.

The D-Lev pitch controls can adjust interval spacings and linearity along a line, but it's the antenna shape that strongly influences how the spacings and linearity change as you aim to the left or right of the antenna.  A plate has more consistent field contours to the left or right of center and is consequently less sensitive to aiming errors in that direction.  But for some players this is actually going to be a negative if they are accustomed to intentionally aiming off-axis for some notes in order to hit the pitch contours tangentially.  If you don't use this technique and your movements are limited to a line directly toward and away from the antenna, this is going to sound like gibberish.  But if you use both finger extensions and large wrist rotations, a plate will have a different feel as you get close to it, and intervals will feel off until you acclimate.  Jumping back and forth between plate and rod antennas is the main concern.  If you play only on plates, I suspect you would never know a difference.

"I mean, if they've already accommodated themselves and their playing style to rigid demands of one form of the instrument, is it too much to ask them to adapt a bit to another?"

Yes.  If there is no discernible advantage to doing so, why would that even be considered?

I mean, Taylor guitars will probably build you a custom acoustic guitar with a 35" scale if you order and pay for one, but they don't just start building them that way and force the customers to accommodate their playing style to it.  In my opinion the rod/loop combination on the D-Lev has plenty of sensitivity and more than it needs for the largest pitch field.  Yesterday I left the theremin on all day to do temperature-rise tests, and as I was going in and out past it the tuner would start showing movement when I was passing within 10-12ft, and this is with metal benches all around.  I can unscrew the pitch antenna from my metal ball swivel, leaving only the 3/4" metal ball and the hot end of the pitch inductor for an antenna and still get a reasonably playable pitch field after auto-calibration.

"One thing that often stands out to me when watching videos of public Theremin performances is the Steve Martin "disappearing dime trick for those in the back row" effect - traditional antennas are so thin it often isn't at all obvious what is being addressed by the player's hands, thus minimizing much of the dramatic effect ("why's that guy waving his hands around?" or "why is that girl standing so still and moving her fingers?").  Plates or larger diameter tubes would be much clearer in this respect."

That sounds like a bit of a stretch for an argument.  You can't see the horsehair on the cellist's bow either, and it doesn't detract from the performance at all.  You see an instrument (whether a flute or a tuba or a plain wooden box) and you see the performer's body movements.  I doubt that anyone misses the fact that a theremin is being played with gestures, and the shape or the existence of the plates or rods or anything in between is probably of no concern.  It only adds to the mystique if they can't see anything, but it's not like the chrome antennas are invisible either.

"I suppose one should at least offer the option of conventional rod & loop antennas, but honestly they feel like a step forward missed."

I would probably say the same if I saw this really incredible theremin-synthesizer that just came out but it only came with plates, which would more than likely be a show-stopper for me.  Certainly not everyone feels that way, but since the D-Lev can accommodate both types of antenna styles without difficulty, it seems to make sense to respect the player preferences and at least offer both types.  This isn't like an analog theremin where minor antenna changes can easily kill one or both of the oscillators.

"I probably shouldn't be so adamant about it though, and I hope no one thinks I'm attacking them personally over this."

No, but it's a good thing that we are separated by several states otherwise I'm afraid we would have to settle this outside .  Now that I know that we are of roughly the same vintage, that is.

Posted: 3/24/2019 12:59:14 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"NOTE: These are only my opinions, even though my opinions get a little strong at times.  It's just one more perspective."  - pitts8rh

Yeah, there's a difference between making an argument and arguing, I hope it's understood that we're both (enthusiastically!) engaging in the former.

"I think it is riskier to ignore legacy and tradition when it comes to the appearance and feel of musical instruments."

Agree, and I do so with some trepidation.  Though I think rod antennas could use a bit of push back for this design.  This is me pushing back! :-)

"My standard for setting up maximum octave interval spacing is "When You Wish Upon a Star", because of the fast octave jumps.  At least until Disney sends lawyers over with a Cease and Desist."

Ha ha!  I tried that last night from memory and it really jumps all over the place.

"Not at all, if you don't mind wiping clean the slate of skilled- and professional-level players and potential customers who understand that a planar pitch field is going to feel different from a cylindrical one, or who simply prefer a more traditional-looking instrument."

The argument from field shape is one that I can't (and won't!) poo-poo; the argument from traditional appearance is a bit weaker IMO but I fully agree that it's a thing.  If there were no engineering differences between plates and rods I would go with rods in a heartbeat.  I mean, why rock the boat unnecessarily.  I didn't really pick plates, i.e. as something to mark or differentiate my territory, they picked me after a fair amount of research.

"The D-Lev pitch controls can adjust interval spacings and linearity along a line, but it's the antenna shape that strongly influences how the spacings and linearity change as you aim to the left or right of the antenna.  A plate has more consistent field contours to the left or right of center and is consequently less sensitive to aiming errors in that direction.  But for some players this is actually going to be a negative if they are accustomed to intentionally aiming off-axis for some notes in order to hit the pitch contours tangentially.  If you don't use this technique and your movements are limited to a line directly toward and away from the antenna, this is going to sound like gibberish.  But if you use both finger extensions and large wrist rotations, a plate will have a different feel as you get close to it, and intervals will feel off until you acclimate.  Jumping back and forth between plate and rod antennas is the main concern.  If you play only on plates, I suspect you would never know a difference."

It's not gibberish, I can genuinely imagine how antenna geometry influences playing style, and it's a real concern.  Though your last sentence is egging me on! :-)

Having developed some intuition regarding C fields from simulation and playing, I imagine though that antenna geometry doesn't really influence far-field playing style much?  That it starts becoming important mid-field?

"If there is no discernible advantage to doing so, why would that even be considered?

Regarding discernible, the LED tuner is a big tell.  It reveals all sorts of stuff, particularly right before null.  Stuff the user would never hear in practical use, but there it is.  Before I implemented the tracking filter on the pitch axis and limited the LCD writes, the null was full of hum, noise, FPGA voltage fluctuation, and LCD update interference.  Now it clearly shows the limits of resolution via quantization steps.  Which is pretty fantastic, but perhaps disconcerting for the user to witness.  To me, the steps near null qualitatively show how much resolution headroom there is when playing.  I knew going into this project that sufficient resolution was a fundamental make-or-break thing, and rods directly relinquish some of that precious resolution headroom.

I mean, Taylor guitars will probably build you a custom acoustic guitar with a 35" scale if you order and pay for one, but they don't just start building them that way and force the customers to accommodate their playing style to it.  In my opinion the rod/loop combination on the D-Lev has plenty of sensitivity and more than it needs for the largest pitch field.  Yesterday I left the theremin on all day to do temperature-rise tests, and as I was going in and out past it the tuner would start showing movement when I was passing within 10-12ft, and this is with metal benches all around.  I can unscrew the pitch antenna from my metal ball swivel, leaving only the 3/4" metal ball and the hot end of the pitch inductor for an antenna and still get a reasonably playable pitch field after auto-calibration."

IMO, with any well-established and widely used musical instrument there is often an "echo chamber" / "tyranny of the majority" type of thing going on.  To some degree, users expect the things that manufacturers as a whole give them.  Industry is profit oriented and risk averse (i.e. lazy), so they tend to offer the same old thing tarted up a bit unless absolutely compelled otherwise.  Having said that, I'm not sure how one goes about changing the Theremin "industry."

Also, most instruments have been around in more or less their modern form for what, centuries?  The technology to build an analog Theremin has only been around maybe 100 years, digital maybe 25.  So what even is a "traditional" Theremin?  The EW with the antennas too close together?  The EWPro, of which very few were made?  The T-Vox, with it's stubbier pitch antenna, and of which even fewer were made?  The RCA, of which ~500 were made?  I would bet that Theremin tried a pitch plate at some point, but rationally ended up using a rod, as that geometry serves a real purpose on a heterodyning Theremin.

Even though they aren't antennas in the RF sense, Theremin antenna geometry can have much the same impact on the final quality of response (in an engineering sense).  Poor analogy: an RF designer works for years on a special receiver / antenna combo to get the SNR and range way up, then the boss says users are uncomfortable with the new antenna and want to use the old one.  So they manufacture it that way and it works, but half of the SNR gets tossed away.  Then a few users raise obscure but troubling issues that the designer suspects increased SNR would fix or at least improve.  What to do?  In this toy / fabricated instance anyway, it's clear that the expectations of the users are holding back the product.

Our recent foray into smaller inductors and higher frequencies seems to have exposed grounding sensitivity issues that, while I'm quite happy to be aware of, are one more boundary to avoid.  And who knows how many more there are out there just waiting to pounce?  Over time with this project I've become massively risk averse to doing anything that erodes the margins of performance, because you never know what will rear it's ugly head when measuring femto-farads between a bag of salt water and a rod / plate with any stability in real-time, on a stage with thousands watching, at the end of a 100' extension cord.

Here's Fastcap simulation of a human body & hand addressing a round 0.049 m^2 plate antenna (top, and roughly what's on both axes of my D-Lev) vs. the Etherwave Standard rod antenna (bottom):

For the plate, the percent difference in capacitance over the range is 11.4.  For the EWS antenna, the percent difference is 6.23, which is a substantial reduction in absolute sensitivity.

In conclusion, where and at what point do aesthetic and legacy playability issues trump fundamental soundness of design?  A judgement call unfortunately, though these kinds of conversations are a big help in figuring out what the issues and expectations are.  But IMO a butterfly wing product like the Theremin needs all the help it can get when it comes to stability, resolution, etc. so it's become something of a "cold, dead hands" "by any means necessary" thing for me.  But I can compromise on just about anything if need be (though expect an airing of grievances!).

"No, but it's a good thing that we are separated by several states otherwise I'm afraid we would have to settle this outside .  Now that I know that we are of roughly the same vintage, that is."

Bring it on, grandpa! :-)  I keed, I keed!  Like I'm a spring chicken...

Being half a continent away is kind of a pisser.

Posted: 3/25/2019 1:47:44 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

The Impact Of Variable Note Spacing On Theremin Cabinetry

I'm thinking that the option of variable pitch field note spacing can be a disruptive influence on the fixed physical design of the Theremin.  If the player sets the spacing wider than that of the traditional analog Theremin, then they will likely need more distance between the player's body and the pitch antenna.

When cobbling together the D-Lev prototype, I positioned the volume antenna under my left hand, with the upper part of my left arm at my side and my forearm at a 90 degree angle.  I find this to be comfortable, with volume control done mainly by hinging my left elbow.  I positioned the pitch antenna the distance of my fully outstretched arm and hand away from my body.  This gives a wide near-field and mid-field playing range, with the majority of playing movement done again via hinging my right elbow in the mid-field.  With wider note spacing one needs literally more "elbow room" to play in.  The control panel was located directly centered in front of my body, with sufficient distance to work the knobs but close enough to easily view the LED tuner and LCD.  The angle back makes it so I'm viewing the LED tuner straight on when I lower my head a bit to look at it.

Here's a top and side view of my setup (to scale except for "me" - all dimensions in mm):


As you can see, the arrangement is quite 3D, which makes fitting the whole thing in a single package questionable and problematic.  I suppose a rod pitch antenna rather than a plate could relax some height issues, but the control box is still a major "angled lump" in the scheme of things.  The more one tries to fit it all in a single package the more one is enclosing mostly empty space with heavy walls, and the more rigidly one's playing technique is dictated by the scheme.  The antenna boxes and control panel are mounted on adjustable ball joints, and while I haven't adjusted them very much since the initial setup, it's nice to have that flexibility.  And it's super nice to be able to flip the boxes around / horizontal when working on the guts. 

The knob section of the control panel could be angled down somewhat more than the display section, though this would lower the visibility of them somewhat, and would make for a more complex construction.

Ergonomically I'm pretty happy with the current arrangement, though it looks like crap on a stick.  It might not be everyone's cup of tea, but it works well for me.  Which of course isn't sufficient for a product many will use and in different ways.  And I'm not trying to beat anyone over the head with the above, just presenting / qualifying / quantifying my seemingly perpetual cabinetry dilemma.

Posted: 3/25/2019 6:09:44 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

Forget about boxes and fancy-schmancy woodwork and ball swivels.
 
I'm building my next D-Lev with two separate antenna modules placed on either side of this:

Posted: 3/26/2019 12:40:12 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I'm building my next D-Lev with two separate antenna modules placed on either side of this:"  - pitts8rh

I can see it now: Pull the recline handle to access the far field and get those longhorn baritone guitar sounds.  

And you could incorporate a butt grounding plate!  

Posted: 3/31/2019 4:52:09 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Scaling Methods

I use many methods to scale encoder values.  Most of the time the encoder value goes from zero to some power of 2 minus one, for instance, [0:63] is pretty popular on my prototype.  Also, most of the time the encoder value is left shifted so that it represents a fractional 32 bit value of [0:1).  There are an infinite number of ways to scale this into an output of [0:1), but integer powers are fairly versatile and quite inexpensive from a computing standpoint.  The obvious scaling functions are squaring, cubing, etc. but one can reverse the curvature (in the linear domain) by doing a logical not before and after applying the integer power.  A logical not negates all the bits, and is the equivalent of 1 - x, where x is the fractional encoder value.  So for squaring the result would be 1 - ((1 - x)^2).  Here are some graphs:


Above: various scaling methods compared in the linear domain.


Above: various useful and simple scaling methods compared in the logarithmic (dB) domain.

From the second graph we can compare these methods used directly logarithmically (e.g. the human ear volume response).  Over the upper 3/4 of the range, squaring produces a roughly linear 36dB change, and drops off towards zero with a total dB over the encoder range [1:63] of over 16 bits, which makes it a nice fit for controlling volume or the cutoff frequency of a filter.  And for the volume case, when the encoder value is 0 the thing being controlled is totally turned off, which is also good.

Used linearly, the not-power-not forms reverse the asymptotic behavior, which can be useful for very roughly emulating things like inverse and square root. Most of the time you're not very interested in a scientifically calibrated type knob, just one that maps well to the useful region of response.

Posted: 4/9/2019 5:55:22 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Envelope Generator (again!)

Ye gods, just can't seem to shake banging my head against the envelope generator, been wandering in the wilderness for days now, trying various things.  I toyed with bringing the pitch number over as an input (harebrained idea I got after hearing a harp on the radio), but there's a "grittiness" to the axis numbers that's really difficult to deal with.  If I were Moog, Inc. I'd just slap a 3Hz low-pass filter on it and call it a day, but you really don't want to lower the basic gestural bandwidth.  Several days ago I gave this a try, and returned to it again today:

The volume number (after linearizing, scaling, and offset pre-processing) goes to a 16Hz second order low-pass filter - now this is just the velocity leg so we can get away with that sort of thing (as long as there isn't a knee, or differentiation, or other type of sharp non-linearity preceding it, and as long as nothing exposes the resulting filter delay).  This gets differentiated and limited (so as to give only positive velocity) and then scaled by the "vvel" knob (which itself is squared to scale the knob range), attenuated a bit, fed to a non-polynomial "quick" version of LOG2, and then the "levl" knob is subtracted from it to scale things over the range of "levl" settings, with another limit applied to floor negative values.  At this point it is added to the "kneed" volume number (where values below "levl" are expanded downward), limited, fed to the envelope generator (which has a peak hold feature as before), then fed as-is to the code which requires a linear version, and exponentiated for the code which requires that version.  The envelope generator fall rate is modulated by the volume number, the "damp" knob, and the "levl" knob.

The low-pass filter allows for much larger velocity gain settings without too much audible grit, which is nice for doing things like automated swells.  Increasing the knee gives it a sharp edge, and the two combined give a controllable sharp plucked sound with decay, which is something I stumbled upon.  And if the sharp edge isn't too important to the preset, it is easily retriggerable by flapping your hand around.

Here's a sample: [MP3]  The preset is a male vocal with series resonator, which sounds rather like a dobro guitar.

Here's the same but with more plucking: [MP3].  It's interesting that the residual volume after the decay sounds a little like stimulation from the "slide".  I must say, having a built-in synth to goof around with and vary the sounds is quite inspiring for playing different songs and styles. 

Posted: 4/16/2019 1:34:05 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Oscillator Redux

For the past week or so I've been taking another look at the oscillator and redesigning it.  One thing that was bugging me was the fact that it's a double oscillator, but with no opportunity to do anything other than octave offsets - no possibility of beating and such.  And I kind of missed the higher harmonic multiplier values of my previous oscillators, which gave metallic bell-like tones when enveloped.  So I resigned myself to adding another UI page to control it (it's amazing how I/O bound this stuff is), looked through Roger & Me's (!) email discussions on the subject, did a real-time inventory of thread 3 and found sufficient resource for things like a second 16 cycle SIN2 calculation per oscillator, and proceeded from there.  Here is the new oscillator module:

The phase increment or frequency number is input on the left and is multiplied by a constant to give the note C8 at full scale (32 bit) input.  In the middle path this is modulo accumulated at a 48kHz rate to give a sawtooth ramp, and multiplied by the harmonic multiplier "hmul" (which is a knob setting subjected to pitch and volume axis modulation).  After this the phase modulation is summed in, with the result run through the SIN2 function.  A single delay following this allows us to close the feedback loop, and a comb filter knocks down troublesome higher harmonics, after which the signal is modulated by the lower path, then feed back as the phase modulation signal.  The upper path is simply the ramp plus the phase modulation fed to a second baseband SIN2 function, which generates the output signal.  The lower path multiplies up the phase increment by "hmul", limits it, feeds it to a LUT (lookup table), and scales it by the "harm" multiplier (another knob setting with pitch and volume axis modulation), which is then used to scale the phase modulation signal.

Two identical oscillator modules are instantiated, with separate "harm" and "hmul" inputs.  A "mix" knob (also with pitch and volume axis modulation) cross-fades the outputs, and the phase increment input to the secondary oscillator unit is multiplied up and down up to one octave for offset.  I currently have the output of the secondary oscillator inverted to give a deep null with the mix knob at the halfway point.  After taking a very close look at quantized simple ratio beats, I decided to go with cubic encoder scaling for the secondary oscillator frequency offset.  Cubing also gives nice wide controllable plateaus around the unison and octave points when quantized [-127, 0, 127].

In the previous oscillator I was using a weird though quite simple polynomial to scale the harmonics.  Problem was it used the full scale phase increment input, and therefore couldn't be scaled with "hmul".  This time I decided to go with a LUT.  PM feedback scaling via linear interpolated LUT is something I should have tried long ago, it's child's play to adjust.  The scaling forms a symmetric sinus when plotted lin/log, which is something I never tried/noticed before.  The nine LUT entries are spaced 2^n which nicely fits the correction and gives super simple math with no dividing.  Byte table entries give sufficient resolution and are quite compact:

Posted: 4/23/2019 2:33:32 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Oscillator Thoughts

My main goal with the D-Lev synth section has been to make realistic acoustic sounds.  A side goal has been to utilize the same DSP path to make wild & crazy sounds.  

1. "Wild & crazy" IMO is kind of a tapped out area in analog synth, making the category rather hum-drum at this point.  "Oh, that's a sync'ed oscillator with a bit of ring modulation, run through a distorted filter" kind of thing.  

2. Non-harmonic waveform content is interesting for percussive sounds, but doesn't make for very pleasant or playable melodic voices. (Non-harmonic resonances on the other hand are quite rich sounding.)

3. Slight inharmonicity can be interesting, such as the beating of two identical oscillators slightly detuned, leading to a phasing effect.

4. Much like piano strings, it probably takes 3 or more slightly detuned oscillators to really start sound interesting.

5. I've experimented with slightly detuning the phase modulation source from the target, which gives a mild sounding undulation.  If nothing else, it makes one aware of how important phase alignment is between the modulation source and the target.

6. There's a tension between detuning and exact alignment both within and between oscillators.  When you want zero detuning you generally want zero (or some fixed) phase offset, so that oscillator harmonics can be properly mixed.

7. Detuning can be ratiometric (multiplicative) or constant (additive).  Ratiometric is good for octave and similar tracking offset, though doesn't sound so good for slight detuning as the beat increases with increasing frequency, so constant is more what you want for slight detuning.

So I'm thinking three oscillators with both ratiometric and constant offsets.  The ratiometric control can be integer-based, and the constant control a fraction of some maximum beat frequency.  You can see why many analog oscillators have both linear and exponential voltage control inputs.

And there's the UI to consider.  I try to put as many interacting controls on a single page as possible.  For instance, the formants could each have their own page, but when "tuning" a human voice you would be constantly flipping pages, so I group the frequency and amplitude of 3 together on a page to restrict basic twiddling to a single page.  I need to do something similar for the oscillators as I find myself flipping pages a lot.  For instance, I don't see a lot of use for individual harmonic modulation of the oscillators.

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