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

Posted: 12/4/2020 3:33:06 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

I guess I'm finally coming to terms with P3 ergonomics and not hating on everything so much.  Moved the crossbar up (even the most flexible seeming of arrangements of key elements will ultimately somehow be inflexible), which allowed the control unit to move up and angle forward a little more.  Now the volume plate, control unit, and pitch plate form a somewhat uniform and highly playable cascade of angled boxes.  The tuner is still kinda high up there in Hogsnuts, MN (I keed), but it's better.  IMO analog Theremins give too short a shrift to the main actors (the antennas) - some for good reason, some not so. 

Maybe the excess volume (enclosing basically slightly warm air and a bit of cabling) lends it a bit of gravitas?  Get out of my way, I desire to gift the world a performance on my Theremin Workstation! ;-)  (h/t to Roger)

Posted: 12/4/2020 3:23:07 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

Another upside to this design is that you only need one video to cover both the teardown and the unboxing...

Posted: 12/4/2020 8:22:21 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Another upside to this design is that you only need one video to cover both the teardown and the unboxing..."  - pitts8rh

Ha ha!

After a morning of safe cracking* I overheard my wife listening to a song in a video, and I thought I'd try my hand(s) at it: [MP3].  (Don't read too much into my Theremin song selection.  I went to church as a kid, so many hymns will be forever ensconced in my head.)

I've been adding random formants ~1kHz or so above the top (nasal) formants of my vocal patches, which seems to increase the realism.  The nose knows.

*Lordy, don't depend on a Sentry fire safe to keep even mildly determined crims out of your stuff.  A magnet opens the digital ones in literally seconds, a minor drilling & some inspection or screwdriver hammering gets you into the dial ones (a few minutes if you know what you're doing, maybe 30 minutes if you don't and aren't looking to destroy it).  At most these safes keep honest folks honest, and hopefully keep your stuff from totally turning into ash.  I don't know how, but the first number in our dial combination somehow changed on its own (24 => 40) hence the need for a good cracking.  I feel vaguely dirty now, like I just starred in my very own little heist flick.  And, as usual: who do I bill for my time?

Posted: 12/5/2020 9:42:44 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

MIDI Mechanics

Ignoring other fiddly details, every ~3ms the Open.Theremin basically does this (CC = control change, MIDI command 0xB):

ALWAYS:
1. IF (volume loop change):
1a. Send volume loop MSB CC

2. IF (pitch rod change):
2a. Send pitch rod CC LSB
2b. Send pitch rod CC MSB

SWITCH (STATE)
CASE (SILENT):
IF (loop CC > trigger point in space):
3a. Calculate note & pitch bend, send bend (MIDI command 0xE)
3b. Calculate velocity, send note-on (MIDI command 0x9)
3c. STATE := PLAYING
ELSE:
3. Do nothing.

CASE (PLAYING):
IF (loop CC > trigger point in space):
3a. Calculate note & pitch bend, send bend (MIDI command 0xE)
3b. Calculate velocity:
4. IF (note change):
4a. Send note-on (MIDI command 0x9)
4b. Send old note-off (MIDI command 0x9)
ELSE:
3. STATE := SILENT

I believe sending the old note-off after the new note-on is an attempt to blend old and new.

It's interesting that 3ms isn't enough time (at the standard MIDI baud rate) to send the ALWAYS CC data (if there are changes in both = 9 bytes) as well as any data in the CASE statement, which might throw off the velocity calculation.  The velocity calculation is almost as strange as that in the D-Lev, maybe this stuff always end up rather oddly ad-hoc?

Volume loop CC data is 7 bits, pitch rod CC data is 14 bits - not sure why that is?  One can pick a variety of targets for this info via the front panel pots (as well as the note on/off point in space).

Posted: 12/5/2020 10:43:46 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

"Volume loop CC data is 7 bits, pitch rod CC data is 14 bits - not sure why that is?" -Dewster

I don't think that 7 bits is enough for smooth pitch variations without glissando.  If I recall correctly in keyboards and such the pitch mod wheel is sort of a special case with 14 bits resolution and almost everything else is 7 bits. 

Posted: 12/6/2020 3:48:47 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I don't think that 7 bits is enough for smooth pitch variations without glissando.  If I recall correctly in keyboards and such the pitch mod wheel is sort of a special case with 14 bits resolution and almost everything else is 7 bits."  - pitts8rh

I think the underlying volume loop general processing for the Open.Theremin is 8 bits, and it's easier to shift this right 1 bit and use 7 bits for MIDI than do an overhaul and expand it to 14 bits just for MIDI CC.

Here are the various CC options:

Pitch Rod CC:
255 // Nothing
8 // Balance & LSbs
10 // Pan & LSbs
16 // Ribbon Controller & LSbs
74 // Cutoff (no LSbs)
         
Volume Loop CC (no LSbs for any):
1 // Modulation
7 // Volume
11 // Expression
71 // Resonance
74 // Cutoff
91 // Reverb
93 // Chorus
95 // Phaser

I suppose these would function rather like Pmod & Vmod on the D-Lev, a side channel modulation type thing.

Posted: 12/7/2020 3:03:13 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

Eric,

A few unrelated (to the latest topic) questions:

1) What current inductance values for your D-Lev pitch and volume are you using, and with your antenna elements what are your resonant frequencies (rough numbers are fine)?

2) What approximate loaded Qs are you getting for each side?

3) Assuming that it would be nice to only have to compile one FPGA load ( to avoid the issue that my Pro causes), what would you consider to be an acceptable range of resonant frequencies for the DPLL without have to go in and change loop parameters?

Rather than just pick some arbitrary set of inductances as I go forward I was thinking of trying to stay compatible with you as long as your inductances aren't too high.  I'm thinking of trying out the coil winder on some different patterns to see what I can get away with for compactness, but I'd like to know what I'm aiming for.

Posted: 12/7/2020 4:45:13 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

[WARNING: Please see EDIT2 below!]

"1) What current inductance values for your D-Lev pitch and volume are you using, and with your antenna elements what are your resonant frequencies (rough numbers are fine)?"  - pitts8rh

(with large plate antennae)
- pitch: 1mH, 1.25MHz
- volume: 2mH, 917kHz

"2) What approximate loaded Qs are you getting for each side?"

- pitch: 2.28Vpp @ 1pF | 195pF = 2.28Vpp * 196 = 447Vpp
- volume: 1.92Vpp @ 1pF | 195pF = 1.92Vpp * 196 = 376Vpp

- pitch Q = 447Vpp / 1.9Vpp = 235
- volume Q = 376Vpp / 1.9Vpp = 198

Methods:
Vpp is measured at the AFE3 C divider, which in both cases consists of 1pF and 180pF.  The Rigol 10x scope probe is ~15pF.  This forms a 1 | (180 + 15) = 1/196 voltage divider.

Tank stimulus is 3.3Vpp - 2*0.7V (two emitter drops) = 1.9Vpp (square wave).  If phase is dead nuts then Q is ~voltage gain.

"3) Assuming that it would be nice to only have to compile one FPGA load ( to avoid the issue that my Pro causes), what would you consider to be an acceptable range of resonant frequencies for the DPLL without have to go in and change loop parameters?"

Main DPLL parameters are set via powers of 2 (simple bit shifting gives "free" multiplication / division in HW) at FPGA build time.  Some are independently adjustable, others are calculated off of these.

- The NCO (and thus LC) upper frequency limit is set by 1.536458MHz * 2^n, where n is a positive or negative integer (or zero).  For example: for P3 the value of n for both the pitch and volume axes is 0 (1.5MHz) to accommodate their LC resonance points.  You obviously don't want the LC resonance located too near to the NCO max, but not too far away either (for max numeric resolution).

- Inductor Q is a direct DPLL loop gain figure.  Reducing Q by some factor will lower the loop gain by the same factor, which will lower the bandwidth of the DPLL.  For example, for P3 a pitch axis Q of 200 gives -3dB @ 140Hz, a Q of 100 gives -3dB @ 70Hz.  The loop gain can be independently adjusted (again via powers of 2) to compensate for whatever the actual Q is, in order to give the desired bandwidth.

- Inductor LC resonance frequency is an inverse (and more complex) loop gain figure, which will alter DPLL bandwidth.  For example: for P3 lowering the pitch LC resonance frequency from 1.3MHz to 1MHz causes the bandwidth to go from 140Hz to 182.5Hz.  Again, the loop gain can be independently adjusted to compensate for whatever the actual LC resonance frequency is, in order to give the desired bandwidth.

In conclusion: If an FPGA build is warranted it should be done.  What makes it warranted can be something of a judgement call, but I can give you real bandwidth figures if you give me real LC frequency and Q numbers, and we can go from there.  Or I can show you how to get these numbers from Quartus (it's pretty simple).

[EDIT] I changed the Vpp measurement to the AFE C divider output, which I trust more because it is lower impedance.  This effectively doubled the calculated voltages and Qs!

[EDIT2] Using the AFE C divider for voltage measurements is ill-advised as it is likely too near the antenna and thus bathed in its strong electrostatic field.  Measurement through a more distant C divider gives Q values in the neighborhood of 100, and concomitant voltage increases.  Please read this post.

Posted: 12/9/2020 5:30:26 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015


" "2) What approximate loaded Qs are you getting for each side?"
- pitch: 2.28Vpp @ 1pF | 195pF = 2.28Vpp * 196 = 447Vpp
- volume: 1.92Vpp @ 1pF | 195pF = 1.92Vpp * 196 = 376Vpp"  - Dewster

Good grief, did you start out designing a Tesla coil and later decide to turn it into a theremin ?

My Pro with a tiny coil on the pitch side ( about .75" x 1.2" #36 wire) is only giving me about 260 volts if I'm measuring correctly. But still...


In conclusion: If an FPGA build is warranted it should be done.  What makes it warranted can be something of a judgement call, but I can give you real bandwidth figures if you give me real LC frequency and Q numbers, and we can go from there.  Or I can show you how to get these numbers from Quartus (it's pretty simple).

I think you gave me pretty detailed instructions on how to do this myself some months ago, but I was mainly asking so that I could at least try to make some coils that would avoid having to do different loads.  I'm pretty sure that anything that I can come up with is going to be inferior to the large air core coils that you now use, but I need to try some radically different things to see what can work in a smaller volume.  

Posted: 12/9/2020 6:01:14 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Good grief, did you start out designing a Tesla coil and later decide to turn it into a theremin ?"  - pitts8rh

That's the absolute beauty of high Q: almost no energy in and a big voltage swing out.  Win/win.

"My Pro with a tiny coil on the pitch side ( about .75" x 1.2" #36 wire) is only giving me about 260 volts if I'm measuring correctly. But still..."

I wonder how much of the swing is determined by the antenna capacitance (and the Q thereof)?  Analog oscillators seem to "like" plates more than rods, sometimes refusing to oscillate altogether unless a plate is connected ("amplifiers oscillate, oscillators don't").  If you stick some tinfoil on the rod antenna does the C divider voltage go up or down?  The smaller the area, probably the more it behaves like an inductor rather than a capacitor.

"I'm pretty sure that anything that I can come up with is going to be inferior to the large air core coils that you now use, but I need to try some radically different things to see what can work in a smaller volume."

Your Melodia build made me look back at the original Moog construction article, wherein Bob states: "Because of their low "Q" and high distributed capacitance, air-core or powdered-iron-core chokes cannot be used in place of ferrite-core chokes to make up the antenna coils."  Huh.

I very much look forward to any results from your coil winding exploits!  Knowing you, they will at the very least be nice to look at!

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