Gain control strategies for poly synths

Status
Not open for further replies.

quarterturn

Well-known member
I am working on a 32-voice synth project and want to come up with a way to keep levels up while avoiding clipping. Each mixer is 4-to-1, so we have to have tiers of mixers at 32 voices. You could set the first tier to 1/32, the next to 1/8, and the last to 1/2, but that's waaaaay too quiet unless you plan on holding down 32 keys at one time.

I've hand-ordered my connections so some simple math can figure out which voice is on which 1st tier mixer group, as well as 2nd tier. Maybe start out with gain set to '1.0' on each input, and as you go above one voice start lowering the gain? I can see this working for simple on/off sounds but not when there's an envelope and especially not with long release times.

If the audio blocks were 32 or 64 bits, we could push the problem out to the end of the processing chain and do some sort of gentle 'AGC' type thing.

Any ideas?
 
There's only one good way for polysynths - a 32 bit DAC and run the signals at about 24 bits which still gives a good signal to noise ratio. Yes I realise 32 bit DACs aren't really 32 bits because of their noise floor, but it is the extended dynamic range we are after in this case. My polysynth has over 4000 sinewave oscillators (not using a Teensy) adding into a 64 bit integer total and I can always find some way of having large numbers of them going.
 
I was looking for a toneprint for one of my TC Electronic pedals and saw the specs: 48-bit in, 32-bit out. Might be 64 or 128 bits internally. Makes sense as you don't want to require guitar players to diddle a gain control or watch an overload LED all the time.
 
I think most things are at least 64 bit integer internally nowadays - ARM 64 bit processors are so cheap that using anything else is silly. Some use 80 bit floating point, most notably PC based apps.
 
As a follow-up, the most gain I could safely get away with is 0.25 on the first two levels of mixers, and then 0.5 on the final two. I have an amp right before the i2s output set to 2.5. I have 32-voices so if you set the release long enough and hit the keys hard enough, you can make it clip if I try to get more loudness from it. I can get OK levels by engaging the 4 db boost on my mixer channel and adding another 5 db or gain on the fader.

Is there a fork where audio_block_t is int32_t? 32-bits is 'enough' headroom for most things, and if you keep waveforms/oscillators to 16-bits you can sum up to 256 before clipping a 24-bit DAC.
 
Status
Not open for further replies.
Back
Top