Teensy 4.0 600MHz ARM Cortex M-7 MCU - ideal for digital MCU based theremin?

Posted: 12/7/2021 1:51:11 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Not sure if I understood what do you mean... Connecting of theremin as a sensor to PC, and performing audio synthesis on it?"  - Buggins

Popular commercial computing platforms tend to change rather constantly and quickly in terms of OS, software, hardware, and electrical interfaces.  (Even "universal" USB keeps morphing around - they need to make a simple moderate speed interface and just leave it be for a decade; stop trying to connect hard drives and video to it.)  Anyway, maybe it's somewhat different now, but my point is that lashing any product or project to that sort of thing can quickly turn it into a paperweight.  One of those tiger-by-the-tail things, where you're at the mercy of the whims of others (and OS folks have some pretty crazy whims).  The performance / price is hard to ignore though, quad core tablets for almost nothing.

"Tablet might work here, but I'm not sure if we can achieve low latency audio."

I'd be super surprised if you couldn't do low latency audio on those.

"General purpose OS (linux, windows, macos) might be not enough realtime."

There are Linux kernels designed for low latency.

"I like idea of using small but powerful MCU as key part for audio synthesis."

I do too.

"It makes sense to have bare metal application or at least RTOS."

Bare metal gives you full control over everything, but there are advantages to an OS like full-blown file system support.  The downside is long boot / init times which I think is unacceptable in a musical instrument.

"But recently, RPI Zero 2 became available. It has quad cores, which may be enough for realtime sound synthesis.  So, instead of Teensy4+tablet, RPI Zero 2 + LCD touch screen may be used."

Are there shutdown / Flash corruption issues with RPI?  Like if you just yank the power it might have trouble booting later?

"Why classic theremin uses far=loud approach? Probably, it was easy to implement in analog theremin."

I agree. Some say traditional volume sense (farther-louder) on your typical analog Theremin is the way it is because orchestra conductor’s hands move up to signal higher volume from the orchestra (or at least that’s the rational behind the movements they make in order to play it). But it’s my belief that traditional sense exists because it leverages the basic non-linearity of the near-field.  It creates a natural knee that ramps up the volume quickly as the player moves their hand away, with more nuanced dynamic control above this. I think Theremin's design motives tend to get over-rationalized, it was probably just physics dictating the obvious and simplest (for the designer, not necessarily for the player) solution.  Traditional volume sense has always felt completely alien to me, to the degree that "fixing" it was part of the motivation behind the D-Lev project.

"Regarding far distance muting post from D-lev thread - about what volume level should we consider as muted. I think, it makes sense to add non-linear distance-to-dB curve at far distances. Starting with distance=-48dB, decrease volume at higher rate"

You'll almost certainly have to implement some kind of explicit knee higher up (in dB) the volume field, and this will expand the low volume section downward (in dB).  But you have a point, even with a knee, traditional volume sense can still present a problem because silence isn't well defined, whereas 0dB is, so locating 0dB near the antenna and reversing the field sense is the ideal situation IMO.  But it's non-traditional, so it isn't THE solution.

[EDITED TO ADD] One way to handle expanding the very low end (< -48dB) to silence is to offset the exponential volume number to zero.  I do this with many exponentially scaled knobs on the D-Lev and it works quite well.  Linear (in an exponential sense) over most of the range, then curves down to zero.  In the linear domain you can use a very simple high order polynomial here (subtract 16th power from repeated squaring) I use this for the pitch preview and noise level controls in the D-Lev (it mostly matches the offset exponential in response, but truly linearly).

"Thinking about cabinet design. Acrylic cabinet made with laser cut will look good enough."

Acrylic can be fragile, these things all hit the floor at some point.  Maybe something more high-impact like ABS?

"Does someone try to use CAD for laser cut design? Trying to learn FreeCAD..."

FreeCAD was a dog when I tried it a while ago.  OpenSCAD has issues too but once you learn it it's quite logical.  If I can avoid actually drawing in a GUI I do.

Posted: 12/7/2021 5:08:03 PM
Buggins

From: Theremin Motherland

Joined: 3/16/2017


Bare metal gives you full control over everything, but there are advantages to an OS like full-blown file system support.  The downside is long boot / init times which I think is unacceptable in a musical instrument.

With tablet as UI/control, and only synthesis part on MCU, most likely we don't need filesystem.
BTW, Theremini starts in several seconds...


Are there shutdown / Flash corruption issues with RPI?  Like if you just yank the power it might have trouble booting later?

There is no internal flash on RPI zero. Only SD card. Of course, SD card may be corrupted by sudden poweroff.

Acrylic can be fragile, these things all hit the floor at some point.  Maybe something more high-impact like ABS?

What about plywood?

I don't have 3d printer. Probably, it's possible to order printing somewhere.
Is it easy to print 400mm length part? (~etherwave cabinet length)

FreeCAD was a dog when I tried it a while ago.  OpenSCAD has issues too but once you learn it it's quite logical.  If I can avoid actually drawing in a GUI I do.

Installed OpenSCAD. It's fun to play. Same sense as when playing with LTSpice

Posted: 12/7/2021 5:52:49 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"With tablet as UI/control, and only synthesis part on MCU, most likely we don't need filesystem."  - Buggins

I agree, though many folks are familiar with the upgrade drill where they stick an image on a USB thumb drive, power cycle, and it happens automatically.  It is a convenience.  But if the librarian can do it then you can give folks more control over the image they run.

"BTW, Theremini starts in several seconds..."
 
The gold standard of Theremins! ;-)

"There is no internal flash on RPI zero. Only SD card. Of course, SD card may be corrupted by sudden poweroff."

That seems like a problem?  Someone trips over the power cord on stage and it bricks right before a concert...

What about plywood?

I'd go for that before plastic I think.

"I don't have 3d printer. Probably, it's possible to order printing somewhere.  Is it easy to print 400mm length part? (~etherwave cabinet length)"

You could print in sections that snap together or something, and do that even on a small cheap printer.  Each section could be tailored to hold controls, tuner, coils, etc.  But it would take a long time and a lot of plastic, and it probably wouldn't look all that good.  There's a fuzzy skin setting in Cura that Roger used to great advantage, but it makes the surface more prone to showing scratches.

OpenSCAD kicks out a really nice STL file, why don't you buy an entry level 3D printer and try some stuff out?  They're terrific for things like knobs, spacers, washers, larger threads, coil forms, logos, wire clamps, sub plates like the tuner and control panel, etc.  The results aren't very good at holding up to shearing forces though, I've had printed threaded rods split in half when my lab unit hit the carpet, even with really high outer wall count and high % infill.  And you can't print really tiny detailed stuff like M3 screws (which would probably shear anyway) though tolerances can be held tight enough to do press fit knobs and the like (press fit knobs are your first line of defense against ESD at the encoders).  If you get one, buy a textured powder coated magnetic build plate for it - Roger sent me one and it gives the face a really nice texture, and parts stick during print but pop right off at the end.  Worth its weight in gold.

Posted: 12/9/2021 4:23:59 PM
Buggins

From: Theremin Motherland

Joined: 3/16/2017

OpenSCAD kicks out a really nice STL file, why don't you buy an entry level 3D printer and try some stuff out?

I have no room for 3D printer so far. My wife will kill me if I bought such thing.


Designing laser cut cabinet for teensy fpga theremin in OpenSCAD.
OpenSCAD is pretty nice. Easy to change cabinet dimensions, sheet thickness, laser cut beam width correction...

So far, modelled main part of cabinet and mic stand flange.
TODO: tablet holder on top of cabinet, antennas, front and rear panel plastic angle, main board, sensor boards, coils, coil mounts, PCB mounts, etc.
I hope it would be possible to export laser cut parts for cutting.



Posted: 12/9/2021 9:31:12 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I have no room for 3D printer so far. My wife will kill me if I bought such thing."  - Buggins

Yeah, they tend to take over a living space.  Mine sits on the top of my toolbox and dominates it, it needs many boxes with reels of plastic, a huge scrap bin, etc.

"OpenSCAD is pretty nice. Easy to change cabinet dimensions, sheet thickness, laser cut beam width correction..."

Vadim you are a fast learner!

I like the way OpenSCAD files can be super parameterized for just about anything.  My D-Lev files are here if you are interested: https://d-lev.com/support/D-Lev_Kit_OpenSCAD_2021-12-04.zip  I spent a lot of time on the iso thread library.

Posted: 12/10/2021 3:44:06 PM
Buggins

From: Theremin Motherland

Joined: 3/16/2017

Laser cut cabinet with tablet holder and antennas.

Volume antenna shape is ugly, to be changed.

No antenna mount fittings modelled so far.

.scad files are available on github.

Posted: 12/14/2021 4:08:58 PM
Buggins

From: Theremin Motherland

Joined: 3/16/2017

Modelling 8 inch tablet on theremin.
Isn't it too close to antenna?
What is better, landscape or portrait?




Volume antenna mount:


Pitch antenna:

Antennas will be made of 10mm chromed water pipe, 500mm length.

Mounted to cabinet using fittings:

Posted: 12/16/2021 3:52:45 PM
Buggins

From: Theremin Motherland

Joined: 3/16/2017

Received my Tang Nano FPGA boards:

Posted: 12/17/2021 5:37:10 PM
Buggins

From: Theremin Motherland

Joined: 3/16/2017

Inductors and PCBs placement corrected.

Coils placed under 90 degrees.

Posted: 12/17/2021 8:17:30 PM
ILYA

From: Theremin Motherland

Joined: 11/13/2005

Received my Tang Nano FPGA boards:

Vadim, max clock frequency for capture timer (approx.)?

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