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

Posted: 4/13/2021 3:09:31 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Block Diagrammin'

Looked around for open source diagramming SW for the manual.  It seems there are three phases to this sort of thing:

1. Reading many questionably (?) sourced on-line reviews,
2. Installing and demoing several programs,
3. Settling on (i.e. "marrying") one.

I say "marrying" because the more work you invest and documents you produce with the tool, the harder it is to change course later (no disrespect to the institution itself).  I picked draw.io, which isn't as integrated as I'd like - it runs in the browser and seems to include one in the install package - but seems up to the job so far (ominous music swell).  I had to turn off the guides to get things to reliably snap / align with the grid.  Also had to enable individual shadows, the global shadows don't work for pasting into LibreOffice Writer.  The weirdest thing is I have to manually text edit the *.SVF file output to remove an annoying comment that otherwise shows up in the image itself - not a huge bother, but one of those picky things that spoils the experience slightly.

After getting some facsimile of what you want drawn, often the other half the battle is getting a reasonable likeness of it into your word processor.  AutoCAD was absolutely notorious here (for me at least), I had to jump through all kinds of hoops to embed pix in Word docs (render vectors to pixels, yielding huge images and therefore needlessly enormous and unwieldy final documents).  These SVF files just drop right into Writer - which is super, super nice.

There's always a fight with any new GUI, and I mean always, and wonder why that is in this day and age.

OT: Going out for my first stabbing today (Moderna Pfizer)!

Posted: 4/14/2021 6:13:43 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Just added some background info and pix to the D-Lev main page: https://d-lev.com/.  Nothing like a little controversy to gin up interest I suppose, but I do want to reassure folks that it's not really any different to play (unless you want it to be different).

Also consolidated the Features and Technology into a single page.

Hope I'm not laying on the self-promotion too thick; having others promote it helps you keep your hands clean - at least in public :-).

Posted: 4/14/2021 7:01:45 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

I can't wait until you add a "How to Play the Theremin" page that uses those art deco hands for illustration .

PS: your UI Quick Reference page is a dead end at the moment...

Posted: 4/15/2021 3:15:04 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I can't wait until you add a "How to Play the Theremin" page that uses those art deco hands for illustration ."  - pitts8rh

Hmm, it didn't occur to me that I had to address that!  Does any other instrument have this section in its manual?  E.g. how to play the tuba?   Do tubas even come with manuals?

For some reason I was surprised lately to find out that the three trumpet valves lower the pitch by 2, 1, and 3 semitones - note fingering was just another mysterious part of my life when I played it as a tween, I don't recall anyone ever telling me there was a simple pattern there, might have helped to pull it all together.

"PS: your UI Quick Reference page is a dead end at the moment..."

Ah, thanks, a typo, fixed.  I also updated the front page diagrams a bit.

Posted: 4/15/2021 5:29:08 PM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Hello,

I just read your 14Bit CC discussion and I am quite interested in this topic ;-)

I was just wondering if you made a decision on the way to manage 14 bit CC ?

Do you plan to apply the same design as Haken https://www.hakenaudio.com/mpe ?
(I also strongly agree with all what they say on this page)

Or do you have other idea ?
e.g. (non standard): 1- receive LSB, 2- Bufferize LSB,  3- Receive MSB, 4- take MSB+LSB into account

Posted: 4/16/2021 2:31:23 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I was just wondering if you made a decision on the way to manage 14 bit CC ?"  - Mr_Dham

I'm adhering to the flawed MIDI standard.  As you know, Haken says MPE didn't fix it, and Haken's MPE+ is proprietary.  I honestly don't know what else to do.  There is the option on the D-Lev to make the key velocity a fixed 64 (the MIDI standard) or fixed 127 (the Haken MPE+ "standard") or variable (sensed via volume hand movement).

I'm only doing MIDI TX so I don't get to interpret any incoming data.  Not sure what I would do there either, perhaps wait a tiny bit after the MSB for the LSB to come in?  A steep LPF to squash any LSB glitching?  Going against the standard seems riskier than going with it, and I don't know the game well enough to feel comfortable breaking the rules.

Posted: 4/16/2021 7:26:15 AM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Without expecting having the same level of precision as haken, I think that you will need 14 bit CC for Pitch only. 7bit CC will easilly do for volume.

I could experience it with the MIDI open theremin: glitches will allways be noticeable with Pitch, Filtering will create latency. 

I didn't find any 14bit CC synth to receive my messages so I created a small FM Synth with "Pure Data".
The theremin sends LSB before MSB. Then the synth bufferizes the LSB to use it in synch with MSB.
This works without glitches and it is compatible with 7 Bit CC synths.
"Midi learn" function on some synth become more problematic because it will catch the LSB instead of MSB...
So you may want to make 14 Bit resolution optionnal.

At the time I chose this design, it appeared to me that it was the only solution, I even thought it was the standard because I didn't find so much documentation on this topic. Today I discover that it is non standard, but I'll keep breaking the rules because standard is useless in this case.

Edit: sending MSB before LSB and bufferizing MSB to use it in synch with LSB on synth's side will also do but you'll loose 7bit compatibility.

Haken's solution is nice, I don't know how much they want to puh to make it standard, simply share it, or make it proprietary... Maybe it worth asking them.


Posted: 4/16/2021 1:36:00 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Mr_Dahm, your approaches are quite interesting, and I appreciate your drawing my attention to them and sharing the details!

I agree that 7 bits of CC are probably OK for volume, but sometimes filter tuning and other pitch type parameters are modulated via breath CC and the like in a synth patch, which could perhaps reveal the limited resolution?

One thing I'm doing in the D-Lev is employing MIDI "running status" when transmitting the CC data, which shaves one byte off of the total and reduces it to 5 bytes.  Another thing I'm doing is cramming all 5 CC data bytes into the TX FIFO at once, so it goes out as one blob with no extraneous timing gaps between the MSB and LSB.  I'm also flooding the MIDI connection to use all available bandwidth when necessary, but holding off on all MIDI processing when there is a data blob in the FIFO in order to present the freshest data possible to the external synth. 

I haven't examined your Open.Theremin software, but could it be that there is some inter-byte timer or something injecting unnecessary data gaps, exacerbating the situation?

The MIDI folks picked a BAUD rate that was just too low.  IMO (and as Haken points out) you need data bandwidth on the order of audio to properly capture note attack.  I don't know, but I imagine the standards people were/became aware of how much this tied their hands, and started doing (dumb) things like "running status" and NOTE OFF = NOTE ON w/ velocity=0, and perhaps this so distracted them that they didn't think through the CC14 MSB/LSB fiasco.  Or maybe MIDI is one of those defacto "organic" standards that started off on the wrong foot and proceeded through additions into a ditch?  I'm not privy to the private history so I probably shouldn't cast aspersions.

"Edit: sending MSB before LSB and bufferizing MSB to use it in synch with LSB on synth's side will also do but you'll loose 7bit compatibility."  - Mr_Dahm

But unless you have a custom synth, that's the only way to keep MSB from zeroing out LSB?  It's too bad they didn't somehow explicitly incorporate "running status" or similar to pull MSB & LSB together.  Heck, they could have just made the LSB CC's full 14 bit like pitchbend and been done with it.

[EDIT] Mr_Dahm, looking at the Open.Theremin code, the MIDI channel mode message 0x7B, 0x00 is used to turn notes off at mute.  Is there any reason not to use 0x78 0x00 here instead, which might mute things faster?  For reference:

https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message

Posted: 4/16/2021 3:52:29 PM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Hi,

I look at this thread from time to time. Most of the time it is a bit beyond my electronic skills but I like the idea of developing such a digital theremin.
BTW, D-LEV website a also a very good idea !

I saw the discussion on MIDI and thought that it would be good if we discuss on some common principle.
 

I agree that 7 bits of CC are probably OK for volume, but sometimes filter tuning and other pitch type parameters are modulated via breath CC and the like in a synth patch, which could perhaps reveal the limited resolution?


Yes, it is true that you may want to control some frequency related things with the loop, for example: cutoff CC 74. However, the player may reach a lower precision but may expect quicker variation with the Loop. In my example of Cutoff frequency: I'll use Loop for a wha-wha effect but I'll use Rod antenna to control cutoff frequency like an additionnal oscillator (resonnance set at max).
That's why I tend to think that 7 bit is fine for the loop. But My opinion is probably biassed due to the fact that open theremin's loop has 8 Bit resolution intenally.


"Running status" is one thing to consider for sure. I didn't felt so comfortable with it initialy so I didn't use it. But it is part of very early standard (I have a book from the 1990's describing it), so it is probably a good idea to use it.


I haven't examined your Open.Theremin software, but could it be that there is some inter-byte timer or something injecting unnecessary data gaps, exacerbating the situation?


Yes,your are right ! MIDI communication on Open Theremin runs in the background task, so gaps can happen. I didn't notice audible effect. But I should consider impementing "runing status" for 14 Bit CC.

Most user will use Note / Pitch Bend messages to control the pitch in a musical mode.  But sometime they may want to use Note messages to trigger a sample and use CC 14 bit to control pitch of an oscillator (as Coralie Ehinger does in an analog mode).

On MIDI standard, take into account that it is almost 40 year old (baurate, 7bits architecture, ... ). Anyway I agree that the 14 Bit CC specification is absurd and forces anyone who wants to control CC continuously (like in "continuous Controler" !) to make proprietary design.

Hence my arrival in the conversation to break my isolation and find some common design for two different theremins :-)

Posted: 4/16/2021 5:01:33 PM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

[EDIT] Mr_Dahm, looking at the Open.Theremin code, the MIDI channel mode message 0x7B, 0x00 is used to turn notes off at mute.  Is there any reason not to use 0x78 0x00 here instead, which might mute things faster? 


You are right, I want to mute all sound regardless sustain pedal position or release time. I should have used All Sound Off.

EDIT
I'll correct it.
In fact,  there was a reason, it seems that early MIDI standard only had "All Note Off" 0x7B.
So we should end sending both to keep addressing early 80's synths !

Usual "Panic buttons" often send both as well probably for this reason.

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