How DSP intensive is FM Synthesis? Teensy / Raspberry?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I think about realizing an Hardware FM synthesizer and wonder if a decent on could programmed on a Teensy/Raspberry.

With decent I mean an 6 OP FM synthesizer with 16 voices wich is multitimbral. Up to six effects, 2 envelopes and 1 lfo per OP, maybe an arpeggiator. Would be nice to have RM too. The dsp would also need to feed an 7" display for graphical representation.

Is this possible from the power a Teensy/Raspberry can deliver?

Thanks
rabbit in a hole

Post

FM on the Rasberry is possible. But you'll have to do a compromise when it comes to sound-quality. You'll have to deal with aliasing and oversampling vs CPU.

Post

Aliasing with FM is kind of a given, though. You can never get it perfectly clean considering how many sidebands you can get very quickly... DX7 never did any aliasing suppression yet it's a classic. It's just a part of the sound there, digital FM sounds "wrong" if there's no aliasing :D

One should be able to do a 16 voice 6 operator FM on a RPi, no problem.

Post

BTW, the free Dexed synth runs on Zynthian, which is RPi-based.

https://zynthian.org/engines/_engine-list/engine-dexed

Post

Autobot wrote: Wed May 05, 2021 6:43 am With decent I mean an 6 OP FM synthesizer with 16 voices wich is multitimbral. Up to six effects, 2 envelopes and 1 lfo per OP, maybe an arpeggiator. Would be nice to have RM too. The dsp would also need to feed an 7" display for graphical representation.
The basic algorithm for "digital FM" (ie. really "phase modulation") is something like:

Code: Select all

 carrierPhase += carrierFreq
 carrier=sin(carrierPhase + modIndex*modulatorOut).
If we implement this using fixed-point, then we basically have two adds, one multiply and one shift-right (to rescale the multiply) to compute the argument to the sine. We replace the sin() with a table lookup (with power-of-two table size) and wrap the index with a bitwise-and and/or shift-right (depending a bit on how you scale your fixed point). If you want linear interpolation of the sin-table, that will cost another table lookup and another multiply (+shift and 2 adds, something like that), but it's not terribly expensive either.

For more complex routing, you need to do a few more adds and a few more multiplies/shifts, but for the most part the whole thing is stupidly cheap (which is exactly why it was such a big deal in the 80s) as long as you have a CPU that can do reasonably fast integer multiplies and having a floating point unit is not necessarily even useful (SIMD might be, but scalar floating point is just going to make this slower).

Post

EvilDragon wrote: Wed May 05, 2021 9:40 am Aliasing with FM is kind of a given, though. You can never get it perfectly clean considering how many sidebands you can get very quickly...
That's not true. My synth Nemesis can do aliasfree true FM and aliasfree PM with any waveform. But it's very tricky to do.

You can directly compare the results within the synth when you select:

neoFM (= aliasfree true FM)
FM/PM (= aliasfree PM/'FM' )
FM/PM vintage (PM/'FM' with aliasing)

Post

Oh I guess since FM is entirely analytical, you could use something like DPW to make it alias-free, or something to that extent. Sure.

Sounded way too clean and not "right" to me, tho, when I demoed Nemess. But hey, all good! :P
Last edited by EvilDragon on Wed May 05, 2021 2:35 pm, edited 1 time in total.

Post

EvilDragon wrote: Wed May 05, 2021 9:40 am DX7 never did any aliasing suppression yet it's a classic.
<insert 'smart aliasing' reference here>
my other modular synth is a bugbrand

Post

I'm thinking you may be able to get very close to aliasing free FM by modulation amount trickery. By precisely calculating and limiting the modulation amount to prevent the highest harmonic from going beyond nyquist with respect to the current pitch. It would be similar to oversampled filtering. It won't give the exact output but I'm thinking it would sound similar. Don't know for sure, never tried it.

On the other hand as the vintage sound it self has aliasing. I bet many musicians don't care, or may like the aliasing.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

I'm pretty sure a Raspberry or Teensy are faster, more powerful than the original DX7 CPU, and have more RAM. Wave LUTs are your friends here, which is what made the magic happen before.

Most of the work has already been done: http://ixox.fr/preenfm2/
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

Oh, and regarding aliasing, it was fixed-point rounding errors that caused any artifacting I heard on my DX21 (4-op sine-only). I don't recall any aliasing, per se, but it's been a few centuries since I used it.
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

Thanks to y'all. Very good first information. I think about kind of a hybrid of preenfm3 and Polyend Tracker.
ATM I try to figure out the hardware specs, layout of the hardware and ui as well as the user handling of the synth itself.
rabbit in a hole

Post

There's a port of Dexed for Teensy as well. More info here:

https://discourse.zynthian.org/t/microd ... to-go/1989

and here:

https://codeberg.org/dcoredump/MicroDexed

Post Reply

Return to “DSP and Plugin Development”