How many simultaneous AudioSynthWaveform objects could be used for a synthesizer??

W5ZZO

Well-known member
I'm building yet another silly synthesizer, and off to a good start... it accepts musical keystrokes and makes sounds (and makes them disappear when a key is released).
I have some keyboard scanning code that will tell me which of 24 keys are pressed or not (and the extra velocity key contacts). It works, and is not shown here.
I am not sure that I need to accommodate a cat laying down on my keyboard in my choice of polyphonic note capability (all 24 notes). Note I have 2 keyboards to work with, but they may more-or-less map to different octaves and sounds (bass keyboard and accent note board.). Ray Manzarek was a master at playing a bass and an organ simultaneously, but one hand on each.
I saw another synth project in these forums that had 22 waveform objects in it. I am unsure if they were all active at once though.
I am planning stereo output to create placement (selective delay and channel volume parameters) and leslie-like effects (phase/volume modulation) to be imposed on the notes.
I am in design mode right now, and wonder if 6/8/12/16?? simultaneous notes are reasonable numbers to work toward, or whether 10 is enough (thumb+finger count on two hands). My general thought is the newest kills the oldest and steals it's channel.
I'm trying to search these forums but specific answers seem to be elusive.

So, if you know something practical that can help, I am all ears!

- Wes
 
I'm building yet another silly synthesizer, and off to a good start... it accepts musical keystrokes and makes sounds (and makes them disappear when a key is released).
I have some keyboard scanning code that will tell me which of 24 keys are pressed or not (and the extra velocity key contacts). It works, and is not shown here.
I am not sure that I need to accommodate a cat laying down on my keyboard in my choice of polyphonic note capability (all 24 notes). Note I have 2 keyboards to work with, but they may more-or-less map to different octaves and sounds (bass keyboard and accent note board.). Ray Manzarek was a master at playing a bass and an organ simultaneously, but one hand on each.
I saw another synth project in these forums that had 22 waveform objects in it. I am unsure if they were all active at once though.
I am planning stereo output to create placement (selective delay and channel volume parameters) and leslie-like effects (phase/volume modulation) to be imposed on the notes.
I am in design mode right now, and wonder if 6/8/12/16?? simultaneous notes are reasonable numbers to work toward, or whether 10 is enough (thumb+finger count on two hands). My general thought is the newest kills the oldest and steals it's channel.
I'm trying to search these forums but specific answers seem to be elusive.

So, if you know something practical that can help, I am all ears!

- Wes

Wes:

In the enhanced version of my TeensyMIDIPolySynth (the original version was featured here in the forum, but I have not yet published anything about the newer version - it is still very much a work-in-progress), I have over 200 AudioSynthWaveformModulated objects defined. Together, these provide 14-poly capability (note: I chose to drop additional notes rather than stealing notes), with three voices per note (each with independent octave control), four independently adjustable VFO waveforms per voice (sine, square, triangle, & saw), with each VFO voice modulated by six independently adjustable LFO waveforms (sine, square, pulse w/ configurable duty cycle, triangle, and saw). In addition, each VFO can also mix in independently adjustable AudioSynthKarplusStrong strings, along with independently adjustable white & pink noise generators. The LFOs each include an independently configurable envelope generator which can alter their input to the VFO modulation. The VFOs also each include an independently configurable envelope generator and an independently configurable filter which can alter their output. The final output includes a single independently configurable ladder filter. All chains can be adjusted by a pitchbend input, as well as a coarse tuning input and a fine tuning input. It's a beast !!

Here's a PDF (I wasn't able to attach an inline picture) of the audio object chain for one voice of one note:

View attachment TeensyMIDIPolySynth - audio chain for one voice.pdf

And YES, all objects can be active at the same time !! I really wanted to make a 16-poly system, but thru experimentation, I found that, with the way that I have particularly designed my audio chain, 15-poly exceeds the processing time allowed for one sample, so I settled for a 14-poly synth !!

I hope this somehow helps to answer your question . . .

Mark J Culross
KD5RXT
 
Last edited:
... but specific answers seem to be elusive.

Yes, indeed. Part of the problem is the amount of CPU used varies depending on many configuration choices. For example, the normal oscillators without modulation are extremely efficient. Teensy 4 could probably implement several hundred of them simultaneously. But adding modulation and selecting the bandwidth limited algorithm adds overhead. You might only get 50 to 150 of those to run simultaneously. Filters can add quite a bit too, especially the ladder filter. You could probably only get a dozen or so ladder filters to run simultaneously, especially if modulating the frequency and resonance on all of them.

Modulating frequency might use more CPU than modulating phase, due to the non-linear exponential "volt per octave" calculation is has to perform for each sample.

This is why the audio library gives you tools to monitor CPU and memory usage. You can see a total of whole library, both the immediate usage and a reset-able worst case which can be handy to make sure you don't miss any bad moments. You can also monitor the CPU usage of each individual instance, if you want to drill down to learn which parts are taking how much of the total.

Click File > Examples > Audio > MemoryAndCpuUsage to see a basic example of how it's done. There's also some documentation here:

https://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html
 
Wow. Two VERY informative replies. I am thankful to you both.
My most immediate worry was how many polyphonic notes to plan for. Following my fellow ham Mark's work, I will allocate 16 and plan to limit some, if needed, after exploring the usage information Paul has made accessible.

Thanks to both!

- Wes (W5ZZO)
 
Back
Top