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

Posted: 2/14/2020 2:50:58 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Paddling Against the Tide

There's something to admire in Theremin designers who just strike off on their own and go their own way on really basic stuff.  The danger, of course, is alienating a portion of the already tiny audience of those interested in the first place.  IMO much of this type of innovation "happens" due to the dearth of convenient and suitable off-the-shelf enclosures which can produce Theremins with good ergonomics.  The Theremin designer / builder is presented with the choice of either cobbling something together with sub-optimal and often distressingly recognizable "found" objects from the hardware / electronics / grocery store, or somehow manufacturing a more suitable enclosure, with all the time and effort that goes into that.  If you are interested in good ergonomics at all, then you will most likely find the enclosure phase of this type of project to be a huge stumbling block - a less tractable a problem perhaps than the electronics themselves!

I've never seen a Harrison Instruments Model 302 in the flesh, and I don't mean to in any way dump on the inventor nor his invention, but most of the ergonomics of that instrument seem to be dictated by the choice of the central plastic enclosure, which looks to me like an standard project box from an electronics supplier.  I don't mean to get into any wars over how things should be played or done either, but my feeling is a completely horizontal volume plate would be OK for the majority of conventional Theremin players, but the horizontal pitch plate wouldn't be.  And it's also my feeling that the pitch and volume plates are probably located too closely together for most conventional players.  (I personally agree with the reverse volume sense, but this is anther sticking point which likely prevents wider adoption of the 302.  But I wonder if conventional volume sense on plates this close might cause more unwanted interaction between the player's hands?)

One thing I really do like about the 302 is the use of metal plates on metal stand-offs, held to the case with screws.  I think bare metal plates / antennas / etc. in general are a mistake and an ESD accident waiting to happen, so I'm not sure how one might fully insulate this sort of connection, but I have thought about cabinets which might employ them:

The nice thing about plates held with a single screw is you can rotate them however you like.  And the AFE and coil remain inside the main enclosure, so there is only a single connection here to worry about.  I don't like how this places the volume coil so close to the player, but maybe that isn't as big a deal as I'm thinking.  Though the bottom end is prime real estate for I/O, and the volume coil is kind of glomming the whole area.  If the enclosure is mainly wood, there will be a certain amount of stray C influencing the coils, and possibly the connections to the the plate antennas if they aren't insulated from it.

After all this time I still don't have a strong sense of the influence of coil proximity to playing.  My prototype completely skirts the issue by placing them smack dab behind the plates.  If one is content with ferrite coils and their downsides, then I suppose this issue would be rather moot.

[EDIT] In the end, you want the cabinetry to work with the overall design rather than against it.  Cabinetry alone can easily make or break a Theremin.

[EDIT2] One could also dispense with the stand-offs and simply extend the plate all the way to the cabinet, with a 90 degree bend in the plate for attachment.  I think I would probably go that route if I were going this route in the first place.

Posted: 2/14/2020 6:24:40 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

"Kicking some ideas around for enclosure-age.  Here's a craaazy one:" - Dewster

If you want something like your "Transformers" theremin we could probably do it.  You could always make the pitch antenna box have an extra segment flip out, or even out and up, to widen the spacing. As long as it used the current boards I would be up for it if that's what you want as your "Tour" model.

Posted: 2/15/2020 5:25:59 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"If you want something like your "Transformers" theremin we could probably do it.  You could always make the pitch antenna box have an extra segment flip out, or even out and up, to widen the spacing."  - pitts8rh

That's an interesting idea!  The killer for me with the "Transformer" is the rigidly fixed angles the plates have.  I'd like the volume plate to be more horizontal and the pitch plate to be more vertical.  One could angle the plates within the case top sections, but then you run out of room for the coil behind it.  One could make the plates sections of large horizontal cylinders, which would leave room for the coils and relieve the angling issue, but then you're playing to the nearest surface rather than to a flat plate, which would probably call for finer "targeting" of the hands.  Plates can - and probably should - have sides and stuff that are more perpendicular to the main plate as this increases bulk C and far field sensitivity, but I prefer my hand to address the bulk of the plate as a plate.

What made me think of the last two designs presented ("Transformer" and "Paddle") was the way the boxes I built my prototype axes in are subsets of the main box (so they could be part of a multi-part cover).  If one could mount those on either side with the ability to rotate them about the horizontal axis then that would be more ideal for me (I think?).  I clearly need a more flexible, functional prototype, and I hope to be getting on that soon with the boards you sent to me so long ago.

Posted: 2/15/2020 5:49:40 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Librarian Commands

Whenever I use the D-Lev librarian software, I find myself fumbling around with the commands, and end up having to consult the "help" page to figure it out.  It's not like it's super complex or anything, but if I'm routinely getting lost too easily in something I freaking wrote, then something's wrong.  So I thought about it for a day and changed the command syntax (naming is the hardest part of coding) and eliminated some paths of interaction.

Here is the "command flow" of the old software:

Naming is often a matter of the main point of view.  In the old SW I took the editor as the main point of view, which in retrospect wasn't the clearest.  The upload and download path through the slots list to the editor was confusing, and rather redundant as one can just as easily interact via the file list.  And the file list is what makes the slots list relevant and coherent.

Here is the new command flow:

So the files list is where the main interaction is now, rather than the editor, and all commands between the D-Lev, files, and editor are "x to y" types.  The general use case is to download a preset to a file, then maybe edit the file, then upload the file back to the D-Lev, with the "DLIST" associating D-Lev slots with those files being a one-way sort of deal.  Since the editor displays and can manipulate both system and user presets, you have to be clear when reading files to or writing files from the editor which of these you mean, hence the 'S' variants of the commands for system presets.

Posted: 2/15/2020 7:36:11 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

"The killer for me with the "Transformer" is the rigidly fixed angles the plates have.  I'd like the volume plate to be more horizontal and the pitch plate to be more vertical." -Dewster

Just replace the pair of hinges for those wings with a single centrally positioned rotating swivel (custom) with friction in both axes. The two axes would be the swing out axis (same as the dual-hinge axis) and the plate rotation axis orthogonal to it.  You would need to be a little more careful aligning things when closing those sections, but it would work. 

"I clearly need a more flexible, functional prototype, and I hope to be getting on that soon with the boards you sent to me so long ago."

I've been thinking about this as I read about your ideas for cabinet designs, some of which I like and some of which are probably more suited to your particular wishes.  I don't want you to take this wrong, but I do think that you could find this whole enclosure brainstorming process easier if you had an erector-set sort of mechanical platform that would allow you to quickly build and try the ergonomics.  You don't need me to tell you that for a lot of these things a day or two of thought experiments can get blown up in a few minutes by a simple hands-on test that may show that a concept simply doesn't work as you envisioned.  Or if it does, you can then allow yourself to lie awake at night thinking about refinement and details.

I thought that the D-Lev prototype carcass that I offered to send to you ( I still haven't tossed it) would have served you well with minimal effort on your part, because you could have hacked it up with any number of antenna orientations and spacings, plates or rod/loop antennas or anything in between and tested them with little more effort than plugging together some pvc pipes and elbows.  If throwing together radically different configurations becomes a tedious build effort each time, there is a natural tendency to limit the scope of ideas and designs can start looking inbred, at least that's how it works for me.  This is sort of an extension of the discussion we had where I suggested that you shouldn't worry (at least initially) about how something would be built or limit the physical design by processes you are familiar with.  Think about how you want it to look and feel, and work backward from there.

For my D-Lev II cabinet that I'm working on now I have accumulated a fairly large box with dozens of failed design experiments. This is after spending a lot of hours designing, studying, and fitting parts together in CAD.  It's no fun fabricating parts only to throw them away, but sometimes ideas evolve and change even before the last part is finished machining.  I think that unless you have a lot of experience in the specific field of design or engineering that you really can't expect to successfully come up with ergonomic designs entirely in your head.

I guess this all sounds a little preachy, but to paraphrase Dr. Frasier Crane: "It's just that it's going to take me a little time to step down from this particular high horse..." 

Posted: 2/15/2020 9:03:38 PM
xtheremin8

From: züriCH

Joined: 3/15/2014

this is a topic i read a lot, but mostly understand not much what you‘re talking about. my tech too small. 
but from time to time i like to give my two cents.
i really like the monkey in the first video. i giggled so much and my friends too. i wish i had one for accompaniment. duet for theremin and monkey.
and also some sounds i heard coming from that digital theremin. some lush voices might need a parental advisory sticker, but i like that. what is really essential is that the sound changes with the pitch. like in this video: https://youtu.be/Yo7I-qsNDMM
and when it comes to constructional things: i know that it‘s a difficult thing, getting design and function together. not to forget the ergonomics, and also the visibility of the player. i mean, like with the theremin of celia sheen, wich is a bit a extreme example, but the player is in plain sight. that „making music without not much around you„ is half of the fun with theremins. also for the audience. i remember and miss the physical contact with the double bass i once had when playing theremin. it can make you feel like so nude.
 @pitts8rh: this is some fine work you did on that ew-pro clone. chappeau!
i saw that linearity video and from what i know looks pretty cool. (i‘m not a aerial fingerer because my hands are meanwhile so deformed.) 
i think the theremino had a rather elegant pitch plate design.
whatever, i’m a traditional pitch-rodder. even if my avatar shows different. bytheway: the two alu-plates on my model are hinged and the brass-hinges are connected to the pcb. so much for my cleverness.
keep the good work going on guys and don‘t forget to meet up someday with at least one pro-player. 

Posted: 2/16/2020 3:52:25 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Just replace the pair of hinges for those wings with a single centrally positioned rotating swivel (custom) with friction in both axes."  - pitts8rh

Yes, that sounds good.  Though another issue I have with it is the antenna boxes being made of the same wood as the main box, which would be durable and everything but maybe too high C (for my theoretical taste, it would probably operate fine) and perhaps too heavy for what little they contain.

"I don't want you to take this wrong, but I do think that you could find this whole enclosure brainstorming process easier if you had an erector-set sort of mechanical platform that would allow you to quickly build and try the ergonomics.  You don't need me to tell you that for a lot of these things a day or two of thought experiments can get blown up in a few minutes by a simple hands-on test that may show that a concept simply doesn't work as you envisioned."

Oh yes, I know exactly what you mean, and I wouldn't take that excellent advice wrong.  Ergonomics (as well as other aspects of the physical design) can really only be evaluated with a mock-up of some sort.

"I thought that the D-Lev prototype carcass that I offered to send to you ( I still haven't tossed it) would have served you well with minimal effort on your part, because you could have hacked it up with any number of antenna orientations and spacings, plates or rod/loop antennas or anything in between and tested them with little more effort than plugging together some pvc pipes and elbows."

I am quite honored by the offer, but your first D-Lev is much too pretty for me to hack on!  I think I need to be able to rearrange the controls and stuff too, which probably calls for a more flexible arrangement.

"If throwing together radically different configurations becomes a tedious build effort each time, there is a natural tendency to limit the scope of ideas and designs can start looking inbred, at least that's how it works for me.  This is sort of an extension of the discussion we had where I suggested that you shouldn't worry (at least initially) about how something would be built or limit the physical design by processes you are familiar with.  Think about how you want it to look and feel, and work backward from there."

That's how it works for me too.  And that's how it really should work for anyone serious about finding the best design.  I've said it (too) many times, but initial physical design should be "beautifully ugly" in that it facilitates and even encourages exploration.  Ideally, the thing should look like Swiss cheese by the time one is transferring to a final-ish enclosure (the design phase never really completely ends).

"I think that unless you have a lot of experience in the specific field of design or engineering that you really can't expect to successfully come up with ergonomic designs entirely in your head."

Agree 100%!  My main problem usually (whether it be for the case, software, or logic) is coming up with initial arrangements to riff off of.  One has to start somewhere, and one doesn't want the start to be enormously far away from the eventual end if one can help it, as things can easily become set in stone at any point, and traversing huge distances in the design space generally mean technical debt and other sorts of pain.  But my imagination is slow and largely subconscious, so I have to mull stuff over forever to move forward an inch.  The cabinet drawings I've been posting lately are just possible, though highly flawed, starting points.

Posted: 2/16/2020 4:37:00 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"i really like the monkey in the first video. i giggled so much and my friends too."  - xtheremin8

The monkey is fun but you have to carefully pick the songs.  I've sent those videos to a lot of friends & family and everyone seems to enjoy them.

"what is really essential is that the sound changes with the pitch. like in this video: https://youtu.be/Yo7I-qsNDMM"

That's a really great video!  Though I think a majority of what we hear in it is due to amplifier distortion, speaker mounting & resonance & overdrive, and room reflections.  Like plugging an electric guitar straight into the console sounds super thin and absolutely nothing like that same guitar through an open-backed amp in a room.  If one were to truly go after that RCA sound one might need an amp simulator to make it.

"and when it comes to constructional things: i know that it‘s a difficult thing, getting design and function together. not to forget the ergonomics, and also the visibility of the player. i mean, like with the theremin of celia sheen, wich is a bit a extreme example, but the player is in plain sight. that „making music without not much around you„ is half of the fun with theremins. also for the audience. i remember and miss the physical contact with the double bass i once had when playing theremin. it can make you feel like so nude."

Yes, my vertical designs are in danger of hiding the performer, though I guess the podium designs of the past like the RCA do this too to some degree.

"whatever, i’m a traditional pitch-rodder. even if my avatar shows different. bytheway: the two alu-plates on my model are hinged and the brass-hinges are connected to the pcb. so much for my cleverness."

I never really mentally processed the Theremin in your avatar!  The curvyness of it all is quite attractive.

Posted: 2/20/2020 12:26:27 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

La La Land

The D-Lev has a whole UI page of knobs I barely ever touch because every time I do it takes a while to reorient myself with how the thing even works - this vague page is "PV_FMOD" and it provides variable zones in the axis fields for filter (oscillator, noise, formants) center frequency modulation.

So I fiddle around and finally re-figure it out, but the controls interact so much with each other and the pvmod controls on other pages that I usually give up and move on.  I finally realized that gain control was already fully covered by the individual target filter pvmods, which left me free to redo the zone controls more like the volume knee.  The "hi" and "lo" are now "loc" and "mul": "loc" sets the spot in the field where the modulation starts, and "mul" sets the strength or slope.  If "mul" is set high enough it saturates, giving a smaller and smaller active zone.

I need to perhaps tweak the strengths and scalings of the knobs, but it's much more intuitive to use now, with much less interaction going on.  In about a minute of initial playing around with it I found a male "la la" sound by modulating the lowest formant with the volume, the mod zone right at the loudest volume: [MP3].  It gets a little repetitive, but I wouldn't have guessed this was a path to "la".

Posted: 2/21/2020 4:29:08 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

To Heterodyne, Or Not To Heterodyne

Vadim (Buggins) over on his Teensy 4.0 600MHz ARM Cortex M-7 MCU - ideal for digital MCU based theremin? thread is describing methods to best capture the pitch axis information in the highest resolution / SNR way possible with an inexpensive processor.  This is a laudable goal and I'm not trying to discourage it nor disparage it in any way, though I do have some thoughts about it because I was going down a similar (though not identical) path a while back, so I have performed a fair amount of research, and even had some pretty clean FPGA code ready to go, before ultimately abandoning it for various reasons.  I'm not saying I'm an expert on the subject, and it's entirely possible that I've missed some vital path that makes it more tractable and attractive, but I want to yak about it a bit.

Heterodyning is the non-linear mixing of two frequencies, producing new frequencies that are additions and subtractions of the input frequencies, and in this case (as in the case of the analog Theremin) we are interested in the subtraction frequency.  The pros of heterodyning are quite clear for a purely processor based Theremin, and indeed this is why you see heterodyning implemented on the Open.Theremin - it's really the only game in town when you don't have a way to precisely produce frequencies, nor the means to precisely measure them.  A D flip-flop or XOR and low pass filter is used to perform the heterodyning, with the result sent to the processor for period measurement. Earlier versions of the Open.Theremin employed the latter, and the latest version employs the former.

A general issue here is the generation of the fixed frequency to heterodyne the variable frequency with.  If we don't have precise control over this frequency then we need to be able to offset the variable oscillator by tuning it, and this is the approach the Open.Theremin takes.  The obvious problem with this is it requires a touchy analog adjustment on a (mostly) digital instrument which could be avoided entirely if the fixed oscillator were adequately controllable via digital generation.  But it is a simple approach, and if you gotta do it, you gotta do it.

The super nice thing about using a D flip-flop as the detector is it removes the high frequency heterodyne content and gives the processor a nice square signal to measure.  The problem with using a D flip-flop is the edges of the heterodyne result can only happen on the D clock rising edge, which quantizes the period being measured.  The introduction of dither (phase modulation) could help to break up the quantization, but I'm not sure how one might introduce this in a processor setting.  One could also perhaps use two flops here to double the resolution / halve the quantization error, but the measuring logic would have to be able to utilize this info in order for it to be actually useful.

The nice thing about using an XOR gate as a detector is you can get analog like precision timing from it.  But the main snag is properly filtering out the high frequency components.  You need a high order, very low Q low-pass filter to do this, and there are many problematic issues associated with this structure.  You want just the difference frequency, but unless you are careful some higher frequency content will get through.  If the higher frequency content is too strong you will get ripples, which will give you trouble when you go to square up the result.  You want it to work over a really wide range but it really attenuates at higher frequencies, so the difference frequency will be quite small in amplitude when the difference is large, which can again lead to thresholding problems when squaring it up.  The ideal situation here would be to have a tracking low-pass filter admitting only the difference frequency and killing those above, but that would be really difficult to implement in the analog domain, and it might get into troublesome modes, as you are filtering the thing that is telling you where to set the filter cutoff frequency, forming a control feedback loop.

Another general issue is that you are averaging periods, and because the periods themselves are happening at a different rate than the rate that you are sampling them at in the larger scheme of things, you essentially have a variable multi-rate process going on.  I spent a lot of time looking at this and it is by no means a simple scenario.  The best solution I think is to vary the averaging rate, which is best done via high order low pass filtering so we are varying the cutoff frequency, with the inverse of the length of the period (i.e. the frequency) - and indeed this is something I do on the D-Lev, though with the PLL frequency number.

Another general issue is the lag problem when measuring lower frequencies.  So you are perhaps best to limit the lowest heterodyned frequency result, which implies offset heterodyning.  If you carefully engineer offset heterodying with period measurement you can improve the pitch field linearity, and indeed this is actually the main reason I was pursuing heterodyning in the first place.  But this inextricably ties together a lot of stuff that's much easier to deal with separately.

Another nice thing about heterodyning with period measurement is it gives you higher resolution in the far-field, and adequate resolution in the near-field.  But I've found that, ultimately, the far field not that useful for playing purposes.  Regardless of the method used, analog or digital, the far-field is fairly unstable and difficult to calibrate for linearity (via the null control) as the rest of the body has a lot of influence over it, so I find myself avoiding it when playing.  My body probably moved a little since I did the acal, the electronics may have drifted a bit, etc. - so I can't trust the linearity out there.  Even analog Thereminists will know what I'm talking about here.

So there's my brain dump from my hazy recollection of what I was looking into years ago.  If I were trying to do an MCU based digital Theremin I might first try to rule in/out the D flip-flop approach, but unless I was really cheaping down I wouldn't go the analog tuning route, as that makes everything too touchy.  If one is instituting some form of crystal or ceramic oscillator for the reference frequency, you might as well use the money and board space to instead install a PLL solution here (tapping off the processor crystal), with fine control via SPI or I2C.  And if you're doing that, maybe a cheap FPGA instead, with the processor inside, etc. - and you're on a slippery slope with something like the D-Lev at the bottom.

[EDIT] We are all playing games in a way depending on the platform we choose to implement a digital Theremin, and Vadim is doing this more explicitly with his project, i.e. limiting himself to the resources available in a particular MCU.  Ultimately, it all comes down to the precision with which we can generate, and particularly the precision with which we can measure, timing.  If thermal noise is the determining factor in all of this then we have adequately precise timing or better.  If we're close, then dither and averaging can help bridge the gap.  If we're miles away then we have to find some other means to generate timing, and then somehow measure slower products of that (i.e. have external processes improve the precision to the point where we can throw some of it away).

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