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

Posted: 1/18/2023 8:41:55 AM

From: Russia

Joined: 9/8/2016

  It's strange to me that they call that kind of note stepping a glissando."--------------

I write through google translator and I see that he is not very good in specific terms, and I do not know how much he lies and conveys my idea accurately ((
I'm afraid that I think correctly, but the printed text will distort.
I write the folk name of the slide guitar as Hawaiian, and the translator writes the ukulele !! And what else can he do?
So sorry for not knowing the language.
And I wrote about something like this sound.
In episodes when there is a smooth change in tone

"Thanks! I think all synths should have a formant filter bank (the D-Lev has 8 formants) as they really liven things up and bring a sense of reality to things. The inharmonic resonator was a fantastic filtering addition too..

Exactly! I have been thinking and dreaming about this for many years, but so far the results are very modest.
(after all, the theremin signal is very mean, poor (sinusoid without overtones). And it seems that its high-frequency components prevent timbre formation)

Posted: 1/23/2023 12:25:20 PM

From: Northern NJ, USA

Joined: 2/17/2012

Think Pink

Several days of pink noise investigation and coding.  This is a great site, although unfortunately suffering from link rot:

The Voss-McCartney algorithm is quite efficient, this site has it implemented on an 8bit processor, with well commented assembly:

The fancy math way of describing the Voss algorithm is that it is the sum of the outputs of a collection of multi-rate sample/hold units operating at powers of 2 rates, each fed by uncorrelated noise sources.  The McCartney spin on this is scheduling things so that only one sample/hold is updated at a time, which drastically reduces the real-time requirement.  If the noise sources are a single bit from an LFSR (cycled once for each sample) then the complexity of the sample/holds and summation of them are also drastically reduced.

So I coded it up and it's running quite nicely, giving a -3dB per octave slope*.  There is some amplitude ripple, but that doesn't matter for synth audio type applications.  The output levels are quantized to the number of sample/holds being summed, in this case 12 (12 octaves covers the audio band down to 12Hz or so) but that doesn't seem to be an issue either.

The trick then is to go through all the presets and come up with new level, bass, and treble settings to more or less match the pink generator output to the old white generator.  Surprisingly, one can get fairly close to pink using the white source, and vice versa: 

Above: White noise source approximating pink noise with bass[16] & treb[-24].

Above: Pink noise source approximating white noise with bass[-31] & treb[15].

I graphed all possible bass and treble settings (independent of each other) and came up with some simple polynomials to automate the conversion in the librarian software.  I also examined all the presets for non-compliance of the output, and only a couple of trivial settings fell into that category, so no real harm done.

There are tons of presets really cutting back on the treble / boosting the bass, so pink noise is just a better fit overall and worth the effort.  I was a little worried that pure noise presets, such as the wind one, might have a noticeable drop in volume as the band pass filter sweeps into the upper range, but that doesn't seem to be the case.

* Pink noise is "1/f" noise, so you might then think that over an octave (a 2:1 ratio) it would have a 6dB (a 2:1 ratio) amplitude change rather than 3dB.  The explanation is that it is a change in power rather than amplitude, and power is proportional to the square of the amplitude, which in logarithmic terms is a factor of 2, so 3dB amplitude change = 6dB power change.  (I've heard it said that "a dB is a dB" but it really depends on whether you're talking about amplitude or power, as this case demonstrates.)

Posted: 1/30/2023 11:04:13 AM

From: Northern NJ, USA

Joined: 2/17/2012

"(after all, the theremin signal is very mean, poor (sinusoid without overtones). And it seems that its high-frequency components prevent timbre formation)" - Martel

Clipping a sine can yield more harmonics, or taking the absolute value of it (though this would double the frequency).  Trivial in the analog domain, but one can't easily do these things digitally without a lot of aliasing happening.

Some Thereminists who use the Electro-Harmonix Talking Machine seem to be able to feed it a bright enough signal.

Posted: 1/30/2023 1:46:54 PM

From: The East of the Netherlands

Joined: 6/18/2019

Aren't analog theremins that can give a pure sinus tone actually relatively rare? A Moog Etherwave for sure does not at any of its settigs. The characteristic of a pure sinus is that it has as mentioned no overtoes and no higher or lower frequency components beside its base frequency. This can be desireable for a beautiful flute like timbre, but when it would be the only timbre available it could soon get a bit boring.

Posted: 1/31/2023 1:51:01 AM

From: Northern NJ, USA

Joined: 2/17/2012

"Aren't analog theremins that can give a pure sinus tone actually relatively rare?"  - DreadVox

Yes, I've never read about or encountered a sine wave Theremin.

Posted: 1/31/2023 2:08:54 AM

From: The East of the Netherlands

Joined: 6/18/2019

"Aren't analog theremins that can give a pure sinus tone actually relatively rare?"  - DreadVox
Yes, I've never read about or encountered a sine wave Theremin.

The central settings of the color and wave dials on my Subscope give what looks like a pure sine wave on a waveform plot, moving those dials from their center position deforms the waveform in various ways, introducing higher harmonics.

Posted: 2/1/2023 2:44:41 PM

From: Northern NJ, USA

Joined: 2/17/2012

D-Lev Linearization = Gamma Correction

Evan pointed me to this article on someone turning their C64 into a Theremin: https://www.linusakesson.net/hardware/theremin/.  In it he linearizes the pitch field by the formula "y = x^0.4 in the range 0–1" which he categorizes as a gamma correction function: https://en.wikipedia.org/wiki/Gamma_correction.  The D-Lev linearizes via fractional power as well - it's a fantastic method (that I stumbled across independently).

Posted: 2/2/2023 2:40:58 AM

Joined: 11/2/2022

Linus Akesson's second appearance in this thread - previous was in post #1871, in 2019...
I was doodling on the 'star of David' tuner shape yesterday as I'd like to eventually swap out my panel for an engraved one, and I found this long article as a starting point for things to illustrate.. given that each point around the perimeter of the star is a note in the chromatic scale.
There's a lot of fascinating art describing circles and harmonic intervals, a lot of the people writing about it are kind of 'out there', but that's what makes this kind of thing so much fun.
Anyways after drawing a dozen different stars with little lines around them, I realized that that starting from any note and just meandering to the next perfect fifth produced this quite pleasing image (described as the "Dodecagram" in the linked article...)

Staring at all the tessellating triangles and hexagons also made me think of the structure of Hive (and the little honeycomb logo in the white paper), and there's a nice "depthiness" to this specific mapping of points... there are no repeated edges, and the whole thing is horizontally, vertically, and rotationally symmetrical.

Anyways - it's going on my tuner.

Semi-related: here's a sequencer that incorporates the same kind of dodecagon-based interval logic. A 1:1 mapping with the D-Lev tuner... Any hope for a MIDI input soon? Joking - mostly...
(Now that I think about it, slap a MIDI interface on the tuner board and turn it into a Eurorack module, you've got yourself a complete product right there...)

And - still can't stop thinking about pitch-color mapping. Here's a brief and pleasant excursion into the subject... the Scriabin (Theremin's contemporary!) circle jumps out as a nice candidate. Even if the critical path for the project doesn't involve RGB LEDs, it might still be fun to for kit owners to mount a little translucent color donut over the white LEDs, a la Vectrex... rotate to transpose.

Posted: 2/2/2023 10:48:10 AM

From: Northern NJ, USA

Joined: 2/17/2012

"Linus Akesson's second appearance in this thread - previous was in post #1871, in 2019..."  - ekahn

Thanks!  And so it was: https://www.linusakesson.net/programming/tty/

"Any hope for a MIDI input soon? Joking - mostly..."

The "data merge" nature of MIDI in dictates many fundamental architectural decisions in any instrument, whereas MIDI out is pretty straightforward.  But the original MIDI protocol itself isn't a reasonable fit as the basis for anything other than maybe a piano type instrument IMO.

The D-Lev synth is fairly simple as these things go, so it might not be all that difficult to make a plugin of some sort to play captured performance data through and make sound in a DAW.  IIRC Vadim was working on something like this, and it makes a lot of sense.

"And - still can't stop thinking about pitch-color mapping."

It would be a good "training wheels" type thing to have the ability to set the major scale notes in any key to a different color.  But I've found any differences in the fixed pattern colors to be too distracting when playing in other keys, where the rotated 2 patterns are often enough to deal with, and the key signature often changes within a song which would seem like an issue.  At this point for me though it's sometimes hard to sort out objective benefit from ingrained preference due to familiarity.

Posted: 2/2/2023 12:57:15 PM

From: Northern NJ, USA

Joined: 2/17/2012

Mighty Morphin Power Rangers

The librarian has a new "morph" command that takes as source the current knob settings, a preset that's in a slot on the D-Lev, or a preset file.  It randomizes some of the knob settings, and then writes them back to the knobs, so it's kind of a live kind of thing that one can play around with.

Obviously if going from a slot or a file to the knobs it's only going to change that file or slot content to some degree, but if the knobs are used as both source and destination the resulting settings will tend to evolve away from the starting settings in steps.

What knobs change and by how much is controlled by a set of command line flags:

Usage of morph:
  -f file
    source file name
  -k source knobs
  -me mult
    eq (bass & treble) multiplier
  -mf mult
    filter multiplier
  -mn mult
    noise multiplier
  -mo mult
    oscillator multiplier
  -mr mult
    resonator multiplier
  -s slot
    source slot number
  -seed int
    random seed (default 1675341953595490683)

So one can use -mo to change most oscillator parameters, -mn to change some noise parameters, -me to change the EQ (bass & treble) of the oscillator and noise sources, -mf to change all filter frequencies including the multi-mode filters on the oscillator and noise source and all of the format frequencies, and -mr to change certain parameters in the resonator.

One can also specify the random seed, so when morphing a slot or a file one can use the same parameters and the the same seed and end up with the same result as before, so it's sort of a way to go back in time.  This doesn't work however when the source is the knobs, unless you replicate every step from the source knobs.

Anyway, here's a live example of morphing the preset files "cello_8", "bell_am_2", and "ufo": 


The first two presets use -mf=1 and -mr=1, then -mf=10 and -mr=10, then -mf=100 and -mr=100.
The third preset uses -mo=1, then -mo=10, then -mo=100.

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