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

Posted: 10/25/2020 6:28:47 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Veni, Midi, Vici

With the synth section feeling done, it looks like I'm gonna try my hand at MIDI out on the D-Lev.  Just ordered a $15 Tbox M3 USB MIDI interface to help with the development process:

MIDI seems fairly doable from a computing resource angle.  Current SW currently consumes ~97% of BRAM so there's no room there, but there is a default "golden" SW load in the FPGA BRAM when it gets pumped @ power-up via its configurator, which gets overwritten by the SW load in the EEPROM (via the bootloader in FPGA BRAM, which never gets overwritten).  One can manually prevent the overwrite by holding down encoder 7 pushbutton @ power-up, a feature that allows the pump of an otherwise bricked load.  (Overwrite also doesn't take place if the EEPROM load doesn't pass the CRC check.)  So one could make the "golden" FPGA load a MIDI only load, and the EEPROM load the normal load, and select between them at power-up via encoder 7 PB. 

There's tons of data room left within the preset files, but I'm thinking the slots beyond +/-99 could be used instead, as 199 presets wouldn't be necessary for MIDI.  Maybe 16 user and 4 system presets?

I suppose MIDI out would be sufficient (no MIDI in), a single FPGA pin connected to internal 8N1 UART support logic at 31.25k Baud (1MHz / 32) which I would have to find room for somewhere in the register set.  Since the baud rate is 31.25k, and it takes 10 bits to transfer a byte, that's 3.125k byte rate.  And since high res commands are often 3 bytes, that's a ~1kHz command rate.  Even assuming you can absolutely flood the synth input with MIDI, a single Hive thread would have all the time in the world to assemble that and ship it out.  180MHz / 1kHz / 8 threads = 22500 cycles per 3 byte command.  Everything could probably be in floats and still easily meet timing.

I think I can keep the preview, tuner, pitch correction, volume knee & envelope, and the axis calibration UI pages and functionality pretty much intact.  When engaged, the D-Lev pitch correction already tries to start on the center of a note, so that might be sufficient in terms of how to handle true note-on situations?  Outside of that (say one really wants to start off-note, or a gliss goes out of bounds) I guess note bend should be associated with note-on (i.e. come before it) to properly position it pitch-wise.  Otherwise there might be two separate systems duking it out attempting to do the same thing.

Moog himself made a MIDI Theremin, and the Theremini does it too, so it must be possible.  Though having both the controller and the synth in the same package probably helps.  Anyone out there who understands MIDI and has some insights into how best to implement something like a Theremin MIDI controller, please pipe up if you have any suggestions.

Posted: 10/27/2020 6:35:27 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

If : [MP3]

Operatic / Ethel Merman version (watch your ears!) : [MP3]

Posted: 10/27/2020 7:33:15 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

Jeez, you're right about Ethel Merman - that might have been identifiable even if you hadn't mentioned it.  Can you post the settings or is it up on your site where I can get it?

It's easy to get in a rut with the formants when doing voices, where they all sound like the same person in different settings.  But this does have something that makes it identifiable, and it's pretty subtle.  I'm still trying to figure out how to set up different types of singing voices without just randomly spinning the dials.

Posted: 10/27/2020 8:29:30 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Can you post the settings or is it up on your site where I can get it?"  - pitts8r

They're both "fem_4_room".  The second is an octave up with a bit less resonator reson, and me flapping my hand around like a maniac.

The resonator makes just about everything better, but when it's doing room resonance it brings vocals out of the middle of your head which somehow accentuates the formants.  I'm starting to think literally all sounds are formants in one way or another.

Posted: 10/30/2020 12:02:31 AM
tinkeringdude

From: Germany

Joined: 8/30/2014

Another cross platform C/C++ IDE I was just recently made aware of. It's pretty new, started 2014 IIRC. Made by those who made NetBeans, a Java IDE, and that thing is probably also made in Java which is an automatic minus point for me  But I know people who swear by it.
So just in case you're not really happy with what you're currently using, there's yet another option.

https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html#wsl-general

I'm specifically linking to this sub page just because I find it funny. (MS has becone pragmatic in some areas)
It describes how to use the IDE hand in hand with the WSL2. The Linux subsystem that recent Windows has, e.g. to be able to use typical compiler tool chains that require a Unixoid environment. It is probably closer to completely compatible and comprehensive compared to previous solutions like msys/mingw or cygwin. Haven't looked deeply into it, but it seems that it's using virtualization hardware features, basically like running a Linux VM on windows, but more conveniently integrated into Windows.

UI overview

Posted: 10/30/2020 4:24:30 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Thanks tinkeringdude!  At $89 / 1st year I guess I'm out.  It is interesting that it uses WSL 2. 

If not for MS and Apple, Unix could (and should, IMO) have taken over the world.  Now here we are: Win has WSL, Apple has POSIX.  There are projects underway to free the HW end of things too, such as RISC-V.  Perhaps it's only a matter of time - time wasted, that is.

It seems C/C++ IDEs are becoming as bloated as FPGA build tools?  I remember when I was still on Win2000 and work and XP at home, the virus file scanner would take like 5 minutes to check my files, then spend another (no lie) half hour at least on the Altera Quartus installed files.  It was so bad that I had to create an exception to that directory in the scanner's skip list so as not to prematurely wear out my hard drive.  Each new release of Quartus was significantly bigger than the last, it was an impediment to my adopting Altera silicon in the first place.  Altera overnighted me multiple DVDs every couple of months and they mostly just went in the trash (to end up in the AOL promotional CD landfill, no doubt).

Posted: 10/30/2020 8:29:58 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Male Room

It's oddly difficult to start with the voice of a certain gender and change it into a significantly different sounding voice of that same gender (though different vowel sounds aren't too hard).  It's often easier to convert, say, a male preset by taking a female preset and just dialing all the formant frequencies down a bit.  This is exactly what I did today with the fem_4_room preset I've been playing the heck out of lately as a basis, hoping that some of the magic of 5 formants + resonator wouldn't get lost in the transition to male.  I'm pretty happy with the result, give it a listen: [MP3].

Posted: 10/31/2020 12:46:29 AM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

That's nice!  I usually try to name the voice, but this is hard to assign.  Closest thing is a Bing Crosby bass/Perry Como mid mix on an old '40s recording.  Throw some random scratches and pops in for realism.

Posted: 10/31/2020 2:54:58 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Throw some random scratches and pops in for realism."  - pitts8rh

A clip made lo-fi (reduced bass and treble) mixed with the "scratch" D-Lev preset: [MP3]

Posted: 10/31/2020 10:12:29 AM
tinkeringdude

From: Germany

Joined: 8/30/2014

Oh, wasn't aware that you had to get a subscription for those, didn't figure the person who suggested that IDE was into that.
I don't rent software (or anything, other than an appartment, and it's not out of preference but only because house prices have become insane) out of principle.

As for being bloated like FPGA tools. It may seem bloated compared to a simple text editor, but it also is and does more than that.
Compared to anything Xilinx made I have seen, these things are slim like a gazelle, ha!

Virus scanners are generally an annoyance. Excluding some folders is inevitable to be able to work at all.
And then they have BS alerts and mess up the updating of a legit software product by, in the middle of it, just grabbing some file and removing it without asking, corrupting the installation, gee thanks a lot Mr. Norton.

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