I'm trying to make a music instrument based on a resonator with a high Q, such as Ableton's Corpus and Ableton's Resonator (I think the former is based on a simple 2nd order resonant filter while the latter is based on feedback combs).
I could make the filters in Matlab without difficulty but my problem is with their gain and the range of their output.
Indeed, to avoid overflowing/saturation of the sound signal, I need to have an output always bounded to the [-1 ; 1] range. Furthermore, these resonators should be suited for processing any type of input : very small transients for percussive sounds as well as continuous noise or oscillators.
I have normalized my biquad and comb resonators to have unit gain at the resonance(s) independently of the Q factor or resonant frequency, based on JOS' book and the STK examples, to prevent overflowing in all cases. But obviously, depending on my filter's input length, the output range varies greatly (even if the input's range is [-1 ; 1]). Depending on the Q factor, there's also a huge variation.
I think I understand the reasons for that : if we take white noise for example, the power is distributed over the whole spectrum, so if you normalize the resonance gain so that it stays at 0dB and filter the noise with a high-Q, you're going to reduce the power of the signal a lot.
If you fix the resonance but change the input signal, it also makes sense that the length of you input is going to change the range of the output, given the recursive nature of the filter.
So my question is : is there some trick to normalise a filter to have an output in almost the same range as the input (or at least a quite constant range), regardless of the filter's Q and the input's length? If not, how are Ableton and other plug-ins designers doing it?
EDIT : One solution that I thought of would be to maximize the SNR for the average type of input, and then provide gain control at the input of the filter and/or a limiter at the output. Is there any better way of achieving what I want?
EDIT2 : Still no answer and I would really like to have some help with that... Any comment is welcome! I have tried on Matlab to find a way to predict the output range depending on
- the filter's parameters
- its frequency response
- the input's RMS
- the input's amplitude
but I haven't found it yet... If someone has a hint or a pointer I would really appreciate!
EDIT3 : By calculating the overshoot of the 2 poles filter (ie the maximum of the step-response), I can guess the maximum range of the output, which is already a start but the analytic solution of the filter's overshoot is very heavy, and it doesn't help finding a relation with the input's length/power, does it?
EDIT4 : After analysing Ableton's corpus a bit more deeply, it seems like there's not much done after all... here are some captures of Corpus' response to some inputs (settings are : type=beam medium, $tune=324.91$, $decay=5.0s$, $Dry/Wet=100%$ and all the rest at $0$) : ^ Impulse response, -30dB
But for example, if I input an impulse at 0dB I'm going to hear the sound clearly and if I input 0dB-peak white noise, I'm also going to hear the resonance perfectly whithout distortion (sound here) With my resonators - either from the EQ cookbook or from JOS's constant gain resonators, I have an extremely quiet output to impulse and normal for noise...