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

Posted: 10/4/2020 7:45:10 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Wha? I thought *that* was the thing to make stuff portable. One less source of unpredictability, diverging float implementations. At least you know the kind of errors to expect."  - tinkeringdude

Kind of.  You can still get real-time errors if you don't compile right (turn off SW traps, but then you're turning off denorms and can get other errors).  And not all modern processors entirely adhere to the IEEE standard.  I think I would have pushed hard for some universal minimal subset that didn't include denorms (but still have them as a defined option in the standard, of course).

"If you don't want computers to be limited to DRAM speeds (ok, they've come a long way, too!), I have not heard of a thing where re-starting the computation world would make this fundamental problem go away."

I think DRAM is a big part of the "problem".  You keep current DRAM with all the latency at that interface and you inevitably end up with caches.  I'd stick a dumb 32 bit barrel processor like Hive smack dab in a field of RAM/DRAM.  32 bit addressing gives you 4 gigs.  If you want more memory you stick another processor or three on the board / in the chiplet.  Cores and RAM always track, and cores aren't getting all that much faster anymore.  You could have 4GB mem & core units optimized for various things like DSP, floating point, graphics, bitcoin mining, crypto, whatever.  Big talk!

[EDIT] I could be way off base, but I imagine 64 bit processors exist to some degree because the floating point unit can then deal with 32 bit integers directly without a loss in precision.  64 bit floats (and the considerable HW support to do that) to be able to deal with 32 bit integers in the float pipe.

Posted: 10/5/2020 11:02:11 PM
tinkeringdude

From: Germany

Joined: 8/30/2014


32 bit addressing gives you 4 gigs.  If you want more memory you stick another processor or three on the board / in the chiplet

That sounds like a setup where any application that needs some serious computing power would have to implement a distributed computing scheme of sorts. That doesn't sound like a simplification from what we currently have to pay attention to at the software end.
Although I guess (new) higher level languages could abstract that away to some extent.
But that also has overhead, if, inevitably, data needs to be shifted between such cores-with-memory.
It also means you can't use the total memory of a system for one big thing in one place if needed - or it needs to stay distributed and deal with the overhead constantly.

Xilinx Vivado can easily eat multiples of 4GB during synthetization. I don't know how much of the RAM content is needed "in one place" (fastest possible access) all of the time. But programs heavy on media stuff are similar.
That alone is reason enough to need 64 bit processors (or at least ways to address more). 4GB aren't that much anymore - even for a tablet, or these days probably smart phones, too. (Although I kinda doubt it's for good reason with the latter... but I have no say in that matter, haha... 2K resolution on a phone... This in itself may be evidence that "because we can" also plays a role on these things. And who ever complained about bigger numbers. Not the marketing department.)
Since the dawn of SIMD there has been a tendency for broader registers anyways.


I could be way off base, but I imagine 64 bit processors exist to some degree because the floating point unit can then deal with 32 bit integers directly without a loss in precision.  64 bit floats (and the considerable HW support to do that) to be able to deal with 32 bit integers in the float pipe.

Have not heard about it explicitly as a motivation - I doubt anyone complained about it, although I personally did not have a use case where both, huge whole numbers, and high precision were needed. The financial world and some scientific computing likes to use arbitrary precision formats, they might sneeze at 64bits.

Posted: 10/6/2020 2:20:15 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Most computing avenues have been gone down, trees barked up, and I'm certainly not bringing anything brand new to the table.  Necessity is the mother of invention, so you can and unfortunately do end up with just about anything as long as it works well enough.  The main thing I just don't get is the seemingly counterproductive over-complexity at all levels.  Computing power helps in many ways to manage itself here, but how many man-years are spent just coming up to speed on the various ecosystems?  For me it's a huge turn off, but I'm almost certainly becoming too inflexible to deal.  Einstein's quote of "everything should be made as simple as possible, but no simpler" I take as just good science / engineering.  Elegant solutions are inherently attractive and should be strived for the art.  Perhaps everything is evolving so quickly in the computing world that there's no time for polishing.  Move fast and break things.

You kids get off my lawn!

Posted: 10/6/2020 2:53:59 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Resonator Redux

I'm working on the inharmonic resonator again.  The block diagram for it hasn't changed in a long time, and I believe this will only involve adjusting the weighting and scaling of the input control values (the details of which aren't shown below):

I'm trying to address the "zinginess" which I believe is due to excessively long high frequency decay for some settings / applications (orchestral strings in particular).  The 1st order low pass filter above (LPF) is used to roll off high frequencies before they are recirculated.  At the LPF output is a crossfade, which allows for anything between full LPF and full bypass of it.

Currently, I'm using the feedback gain (km in the diagram) to modulate the LPF corner frequency (w in the diagram) - specifically, the square of the "reso" encoder value.  This tends to open up the LPF for higher resonance settings, where high frequency components will be more obvious, and are needed for things like bells and such.

And the total delay time (z^-(n+m) in the diagram) is used to modulate the LPF crossfade (xmix in the diagram) - specifically, the square of the negated "freq" delay time encoder value (which is inverted and scaled to give frequency, rather than period, control over the delay time, which is more intuitive for the user).  This tends to remove the LPF for shorter delay times, where the resonator is acting like a high frequency comb filter.

Up until yesterday I wasn't squaring the "reso" encoder value for use as w.  As you might imagine, that tended to keep the LPF cutoff too high for lower "reso" settings.  Using the square now seems to help reduce the "zing" of things, and doesn't disturb all of the various existing presets too much.  But is there a better way?

it's probably clear just from inspection that when w=0 the LPF output is unchanging because there is no feed-forward path.  But one thing I wasn't aware of until last night was the behavior of the 1st order LPF when w=1: it's a straight-through wire!  So you can bypass the LPF by just using w!  Does this mean the crossfade around it is unnecessary?  Not necessarily, because the crossfade gives you the option to roll things off in a shelving manner, rather than just a 6dB/octave, 20db/decade manner.  And it takes very little deviation below a gain of 1 in the recirculation path to kill signals dead after just a few passes though the loop, so the whole construct is quite sensitive to gain.  So I need to come up with a function that combines both "freq" and "reso" control over w to test, and hopefully in the process determine if LPF crossfade shelving is desirable / detrimental.

Posted: 10/7/2020 8:11:18 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Reso Combo Function-o

Here's the combo function I came up with to control the cutoff frequency of the LPF in the resonator feedback path:


The "freq" and "reso" knob encoder values are each made full scale, then squared, then logical bit not-ed, and the two results are multiplied together, with the result bit not-ed again.  The whole idea is to open up the filter if needed by either "freq" or "reso", and this is accomplished by the inversion and multiplication, which drives large values to zero (x*0=0), which when inverted again produces large values (i.e. high LPF cutoff frequencies).

It seems to reduce resonator "zing" while also allowing for bell type long decays, with the threshold of muted type sound around "reso" = 32, or the 1/2 way point, largely independent of the setting of "freq".  And it doesn't seem to mess too badly with existing presets, even the bell variety.

This control scaling could be finessed further with offsets and exponentials, but I'm pretty OK with the way it is, and there isn't a ton of real-time left on thread 6 to get too fancy (though a non polynomial exp2 only takes 7 cycles).

I love what the resonator does for female vocals: [MP3].  I think I'm a bigger fan of ambience than reverb.

Posted: 10/11/2020 4:14:31 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

It Don't Mean A Thing If It Ain't Got That Zing

I've been taking an even closer look at the resonator.  Here is what I'm currently working with:

It's the same as before with the output crossfade around the LPF removed (as described in the last two posts) - but the output has been moved from the output of the bulk delay (z^-m) to post LPF.

I temporarily removed all influence of the freq (inverse global delay: z^-(n+m)) knob and reso (Km) over the LPF cutoff (w), and co-opted an unrelated knob for dedicated independent control of LPF cutoff frequency.  This allows me to test the influence of all of these parameters independent of one another.

Some observations:
0a. Complete elimination of "zing" is not possible due to the phase cancellation that happens when the resonator output is crossfaded with the input.
0b. So "zing" is probably more of a feedforward (I/O xmix crossfade) phenomenon than a feedback (recirculation) phenomenon.
1. With ambience / reverb type effects, the realism seems to rely heavily on rolling off both direct and recirculated high frequency content.
2. Pseudo stereo doesn't seem to rely all that heavily on very high frequency content, it's more of a midrange & upper midrange kind of thing.
3. LPF w below 750Hz or so isn't all that useful because it is too dark (i.e. rolls off too many highs).
4. LPF w around 1kHz gives a good balance between pseudo stereo, ambience, and special effects type enhancement.
5. With larger ersatz reverb settings, LPF w completely dominates feedback Km, which makes sense as it can do much more in the way of feedback attenuation, and it doesn't take much (Km only has a 7:1 range).

Bells and such would need the LPF to fully open up, so something has to happen there.  I'm wondering if having freq modulate reso, and having reso modulate LPF w might be the way to go?

Every time I work on this I think of the reverb controls in the XMplay music player: just room size and intensity, but they cover a lot of ground and sound nice.  We of course need fine control over the resonant peaks and dips in the inharmonic resonator, hence the need for more knobs, but a good goal is to limit them to a maximally useful minimum.  No one wants to be hamstrung by too few knobs, but no one wants to turn a knob 10 menus deep that doesn't do very much.

Posted: 10/11/2020 5:45:26 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

No one wants to be hamstrung by too few knobs, but no one wants to turn a knob 10 menus deep that doesn't do very much. - Dewster

Pfft.. that's nothing.  Cura slicer has 450 knobs, some of which are several layers deep, so this is child's play .

Actually, when you get to D-Lev IV redesign with the 15" OLED touchscreen you need to offer a user level option to display only those menu items relevant to the chosen level, like basic, advanced, expert, etc.

Posted: 10/12/2020 1:44:31 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Actually, when you get to D-Lev IV redesign with the 15" OLED touchscreen you need to offer a user level option to display only those menu items relevant to the chosen level, like basic, advanced, expert, etc."  - pitts8rh

The first one has taken over 10 years, so D-Lev Mark IV should release in 2050 - and will work off your brain waves! ;-)

Posted: 10/13/2020 2:48:04 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

3D House Of Stewardesses

I've got an SCAD file containing features common to most D-Lev parts, which the inclusion of speeds things up and helps keep typos from causing mayhem.  Here's the latest print of the main panel, tuner, and knobs (the random stripes are where the slicer decided to lay the plastic down from the other direction, you can't feel them by running your finger over them):

The first layer is really critical, and I think I've got that more or less under control by giving things sufficient time to warm up, and lowering the first layer flow by 5% or so.

Still working on the pitch and volume plate design, some 1/2 scale models:

Covering the back with foil might be a bit tough with all the stiffening ribs sticking up, so the one on the right is a trial to use a thicker plate on the backside with cubic infill to get the required stiffness.  The female threaded post (M12 x 2) will support a custom washer that corrals the coil bottom and smushes the foil underneath down.  The grooves around the edges will accept cardboard or similar with internal conductive face.  A similarly grooved top will secure the coil and sides, and have the AFE mounted on it.  Conveniently, both AFE connections naturally end up there (conductive sides and coil drive wire).  So I'm thinking regular aluminum foil for the face, and vertical strips of aluminum tape on the sides, with the foil in the groove and the top / bottom compression providing the necessary conduction.

I plan to try stiffening the tuner face this way too - a thicker back portion with cubic infill, rather than ribs.  For the antennas, a thicker plate might slightly lower the risk of ESD, and no one needs to get all that close to the plates anyway.

Had what felt like a productive day working on the resonator, will post about that soon.

Not trying to bore you nor blow my own horn, but I just can't get over the realism of my latest female vocal patch, it's almost scary to play (and I play it a lot!): [MP3] (that's with the latest resonator mods doing ersatz pseudo stereo reverb and no outboard effects - it sounds somewhat metallic, but not too lame for as simplistic as the signal path is).  Who would think that female falsetto could be basically the same formants and setup and all as non-falsetto?  Not me.  Play this patch in the higher registers and it sounds like something dynamic is going on, but it isn't.  The Theremin is amazingly well suited to doing female vocals, its true calling IMO.

Posted: 10/13/2020 12:54:55 PM
pitts8rh

From: Minnesota USA

Joined: 11/27/2015

3D Prints

I have to say again that your prints are looking very good.  The lower three look exceptional and especially so considering that they are half scale.  The internal hole strings are almost unavoidable.

I know you're trying to minimize time and material but you may want to just leave the ribs out and do a few millimeters of infill grid with a couple top layers.  It will make the foil easy to apply but will provide more ESD protection.  I wouldn't count on the printed plastic to provide much of a discharge barrier compared to a solid plastic, so an air gap is probably better to have.

You would probably really appreciate having a textured flex plate at some point.  It makes the first layer a little easier to lay down and it looks pretty too. And I think I mentioned it before but if you want to try a different surface appearance you can in Cura change the top/bottom line directions (under Shell) and infill line directions (under Infill) from the default 45 and 135 degrees to 0 and 90 by replacing the "[]" with [0,90]. I've started doing this for a lot of things because getting rid of the diagonal lines makes the part look a little less printed.

Latest Resonator Software

The 912ef289.spi load is the best yet.  I'm able to have plenty of low- and mid-resonance on the strings without fighting the treble resonances.  Although they are still there they seem to be much more naturally muted, and they are easier to control with oscillator pmod and filtering or by simply compensating with playing technique.  I'm finding that when spinning through all of my various string mutations that were previously abandoned they are now usable with only a few tweaks.  I don't even know where many of these originated (violin, cello, etc) but they all sound different and most are working very well over several octaves. It's easy to come up with dozens of variations that all sound good.  These changes were worth the effort, and I hope that we can stick with this version for a while.

Female Vocals

I went right to your vocal sample and my immediate impression was that it was a spooky sound, and then I read your similar description.  Voices, like strings, are hard to stop playing until the butt says it's time to get up and do something else.  When I'm not spinning knobs on string presets I'm working on vocals, which are equally if not more sensitive to minor variations.  I'm finding it a little hard to get comfortable with identifying which formants contribute to certain vocal attributes.  It's easy to get into a rut by making endless variations on a given voice to change the brightness or add dynamics but they don't always make it sound like a different person. And then you have to avoid getting nasally or chipmunky over pitch changes.  I'm currently playing
some lines from Radiohead's "Creep" as performed by Haley Reinhart , and I'd love to be able to come up with some semblance of her voice (impossible, yet I persist) for a preset.  So far I've shifted some formants, boosted the second harmonic by using 1OSC, and tuned noise for the breathy sound.  Lots of variables to learn, but it's fun learning.

 

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