Forums > MaxMSP

Smoothing the discontinuous stepped output from Peakamp

Jul 23 2010 | 9:56 pm

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.

Jul 24 2010 | 1:22 am

-- Pasted Max Patch, click to expand. --

Jul 24 2010 | 1:27 am

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.

Jul 24 2010 | 2:23 am

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.

-- Pasted Max Patch, click to expand. --

Jul 24 2010 | 3:25 am

Very interesting demonstration. Thanks Christopher!

Jul 25 2010 | 10:06 am

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.


Jul 25 2010 | 10:09 am

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.


Aug 02 2010 | 9:46 am

Thanks to Christopher Dobrian. Using peakamp with line~ works perfectly. Problem solved.

Viewing 8 posts - 1 through 8 (of 8 total)

Forums > MaxMSP