Hi, Pd people!
I want to overlap an audio signal with a sound generated by five formants. These formants will be generated by a bank of filtered white noise. The filters I will use for this purpose will be bandpass filters, which need the frequency and Q parameters of the original signal to create a smooth overlap.
with fiddle ~ I can get the frequency and decibels of each of the formants, but how I can get the bandwidth?
I appreciate any advice.
You can get a continuous envelope from the audio signal with:
then you can turn it into a digital signal with parameters for a low pass filter for attack/release:
threshold attack coefficient
env [dbtopow~] | release coefficient
| | | |
[expr~ $v1>$v2; if($v1>$v2, $v3, $v4)]
next, you can low pass filter to smooth the signal, at different rates for attack/release:
[pd low-pass-filter] -- check Miller's book on how to build filters using czero~ cpole~ etc
then multiply the input by the envelope
hold time is more tricky to implement, and I'm not quite sure what that means for a noise gate.
I built a compressor/limiter in a similar way, not a very good one, but enough so that if I'm live-coding I can just feed everything into it and not have to worry too much about adjusting the volume to avoid clipping etc.
wow, that's elegant.
[mavg] is too cpu expensive? or at least more expensive than [*~] and [lop~]? I use [mavg] when need a smoother signal.
well, thankyou very much Claudius Optimus et Maximus.
anyone knows which window (hann, hamming, rectangular, gauss, etc) is the best if you want a convolution with a wide range of formants?
Hann is not so good in real time, I noticed, because the sound generated has just one formant, and the result is very similar to a resonant filter...
if anyone has a clue, please share it!