Smoothing the discontinuous stepped output from Peakamp
Here is a patch intended to use the amplitude of one signal (speech) to control the amplitude of another (in this case music). Peakamp does this very effectively but the output is stepped. You can hear the sample points as an audible click. Is there some way to smooth this out?
I tried using number~ instead of peakamp. You should be able to input a value in milliseconds in the right input to create a ramp between each sample, but it doesn't seem to improve things. Also it doesn't sample the peak level and you don't have so much control over the sample rate.
Raja beat me to it :)
If you want to control audio with audio, don't enter the schedular-domain. You'll have to do a lot of smoothing and it will be less responsive.
I think taking the abs~ of the control signal into average~/slide~/rampsmooth~ will give you much better results.
In my experience, taking a low-frequency sampling of the peak amplitude of the signal (e.g. with peakamp~) and smoothing that (e.g. with line~) gives an intuitively much more accurate representation of the audio signal I'm envelope-following than does smoothing the audio signal itself, which tends to smooth out -- and thus lose -- all the more interesting characteristics of the signal. Here's an example that lets you compare. When using a signal with sharp sudden changes in amplitude (e.g. a snare drum ) as the control signal, the sharp attack is greatly attenuated by smoothing the audio signal, but is retained by tracking the peak amplitude.
Very interesting demonstration. Thanks Christopher!
is that a philosophical matter or one of engineering?
normally one can say everythign what remains in the signal domain is sampleaccurate
and so it is more accurate than the sheduler, for example 96 kHz compared to only
1 kHz for messages.
but building dynamic analysis stuff is always a diffictul task ... often you have to
try out several different methods until you find what seems to be the best solution.
i may suggest to not forget the meter~ object - or the possibilty to calculate yourself
what avg~ or average~ are doing using math objects in order to have more flexibilty or
new forms of analysis not found in the average~ object.
-110
btw, one should also not forget the following option.
when you create "sidechain input" based on average~ and rampsmooth~, you can
also try to scale the signal from rampsmooth~ to get a different behavior.
-110
Thanks to Christopher Dobrian. Using peakamp with line~ works perfectly. Problem solved.