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

Posted: 12/1/2019 12:15:15 AM

From: Northern NJ, USA

Joined: 2/17/2012

"Print design is about unrelenting fastidiousness across a broad range of disciplines." - from: https://opensource.com/article/19/4/linux-graphic-design-tools-professionals

Nice article, and so nicely put.  I dabble in the graphical arts, so I fancy that I can at least somewhat appreciate all that goes into it.  IMO this applies to digital Theremin design as well.  So many details to attend to, requiring background in programming, DSP, filtering, synthesis, sampling, alias suppression, rate conversion, UI, etc.  And if you're designing the processor as well (my vanity project) that's even more that you need to be unrelentingly fastidious about, because everything is built on it.  But you don't need to know everything up front, the process itself is a great teacher.  Beyond the math identities, I knew almost nothing about inductors going into this - so anyone can play this game!

[EDIT] Trivial, but the Hive assembler / sim is now in a blue motif:

Thanksgiving is over, but a busy week of volunteering ahead.  I hope to start on a console based librarian of some sort after real life calms down (and I suppose I've given up on the whole GUI thing for the foreseeable future).

Posted: 12/16/2019 3:48:25 PM

From: Northern NJ, USA

Joined: 2/17/2012

Win32 / Linux Hive Sim Homologation

While I was back in Win32 doing some D-Lev work over the weekend (updating FPGA loads, compiling them, and capturing all of my current presets), I brought the Hive assembler / simulator, as well as the console based calculator I've been working on, into alignment for the two operating systems (WinXP and Linux Mint).  The sim work went pretty well, though I discovered some keycode errors: some Win32 keycodes had the wrong escape prefix.  I also discovered some Win32 keycodes that weren't unique, as well as some that didn't work at all (captured by the OS / console and not passed on to the application).  The whole used / reserved key situation in operating systems / consoles is kind of a mess, but at least now I've a known working common subset (for now).

With this and my console calculator coding, I've got many basic building blocks in place to write a preset load / store / display type console application for either OS.  I think selecting / accessing the serial port will be the most difficult, and will start on that soon.

But today I'm reading up on the Geany IDE help files to see how to implement HAL assembly syntax highlighting.  I'm hoping it won't be more difficult than the previous gedit XML regular expression exercise, because that was a total bear, and it left gedit in a weird state for general editing use.  I'm glad in a way that I was able to give Ubuntu a spin before blowing it away with my switch to Linux Mint - it let me make many basic mistakes that I didn't end up having to live with long term.  Another reason to distro-hop I suppose, at least at first when you're getting your feet wet with Linux.

[EDIT] Finally got HAL assembly code looking pretty good in Geany.  Didn't go so crazy this time as I did for gedit.  Also added SystemVerilog highlighting to Geany (was my training for HAL).

Posted: 12/21/2019 4:52:17 PM

From: Northern NJ, USA

Joined: 2/17/2012

UI Settings Display

Working on the preset librarian, so far it can read and write preset files, crudely edit preset files, and render the preset UI screens to a string and to a text file:

Above is my current cello preset, and it also shows my particular system settings.  Screen names are in all caps at the lower right, system setting labels start with a capital letter, user preset labels are all lower case.  As you can clearly see, the cello uses six formants and the resonator for the cello body, with all oscillator harmonics mixed with some odd harmonics and filtered, along with some filtered pulsed noise for the string sound.  You can also see that there is global bass accentuation, and that I play the cello voice with a fair amount of pitch correction.

Even at this level the librarian code is quite useful, as it enables a preset to be examined at a glance, rather than via paging through the various screens on the D-Lev, and with it a preset can be easily printed, sent to another user as email text, etc.

I rearranged the UI screens a bit to display better in this 4 x 5 grid (swapped noise & osc screens, moved the resonator from after the formants to before) and will soon edit the D-Lev SW to have the same order.  In particular, I like the way the oscillator, noise, and formant screens appear in single rows with this arrangement, as well as the last row being all system screens.

Posted: 12/22/2019 6:48:34 PM

From: Northern NJ, USA

Joined: 2/17/2012

Patch Librarian (so far...)

Got the command line and console view working this morning:

Can read, write, and print (to a text file) preset files via the command line.  Can't do any editing via the command line yet, I intend to implement some kind of highlighting system with the arrow keys to facilitate that.  The system preset is loaded by default at start-up to remove that step.

You can see my tenor patch here.  There are 4 formants at 196, 719, 1077, and 2217Hz.  The first is throat radiation and the level is set somewhat lower than the others.  The next two are mouth radiation, and the last is nasal radiation.  I placed all of the formants in the PV modulation slots to make it easier to do that (if desired, the other 4 formant slots are fixed frequency).  The oscillator again has a bit of square wave mixed in (thanks Roger!) and the noise is again pulse width modulated and filtered.

Now to experiment with serial port communications...

[EDIT] Got the highlighting editing system working.  ALT+arrows turns on edit mode and moves the highlight around the parameters, +/- keys increment / decrement, ESC exits edit mode.  Works great!

Posted: 12/23/2019 5:56:33 AM

From: Theremin Motherland

Joined: 3/16/2017

Didn't you try to use excitation signal closer to real one?
Inverse filter sample tenor wav, then use averaged period as periodic excitation and the rest - to compute noise parameters.

Posted: 12/23/2019 6:52:17 AM

From: Northern NJ, USA

Joined: 2/17/2012

"Didn't you try to use excitation signal closer to real one?
Inverse filter sample tenor wav, then use averaged period as periodic excitation and the rest - to compute noise parameters."  - Buggins

No, nothing that fancy, unfortunately.  Though I think it's close enough to do fairly convincing vowel type vocals.  The self-PM oscillator is a nice variable harmonic content glottal source.

[EDIT] I'm happy to announce that the vocal analysis program Praat (http://www.fon.hum.uva.nl/praat/) works just fine in Linux Mint!  A single file, just download the tarball and run it.

Posted: 12/24/2019 7:41:39 AM

Joined: 3/23/2014

'Praat' is in the repositories of Debian so you also can install it with your software manager or with the command 'sudo apt install praat'  I think this will be the same in mint

Posted: 12/25/2019 2:01:54 PM

From: Northern NJ, USA

Joined: 2/17/2012

Thanks v7peer!  I didn't even think to look in the package manager, but there it is!  Though I'll probably stick with the one I directly downloaded it because it's version (6.1.08) is later than the package version (6.0.37-2).  I wonder why there is so much old SW in the package management system?

Happy holidays!

Posted: 12/25/2019 6:41:59 PM

From: Minnesota USA

Joined: 11/27/2015

Whenever your patch librarian is usable, I want!

Posted: 12/25/2019 8:33:24 PM

From: Northern NJ, USA

Joined: 2/17/2012

"Whenever your patch librarian is usable, I want!"  - pitts8rh

Oh yes!  I've got the file reading / file saving / patch display / patch editing parts more or less passably done today.  Still no serial port connect code / work, which may be quite different for various operating systems (I'm looking at you MSWin!).  Any chance you'll be giving Linux a shot in the near future?

It might be interesting to have it modify parameters in real-time on the D-Lev, though triggering it to make sounds might be problematic, and the parameters location in memory would probably best be nailed down rather than floating (or accessed via some new UI commands).

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