Forums > MaxMSP

Envelope Following

February 6, 2007 | 5:26 am

Since i’ve seen this topic a million times discussed on this forum and I’ve been overcome with the urge to discuss it… here it is.

There are so many different ways to create envelope followers in MSP. Slide, rampsmooth, vectral, deltaclip, low pass filters etc. Now I want to here what people have to comment on the affectiveness of using each for a particular application. One thing I’ve been working on some time is envelope following percusive signals. This requires a signal network that is quick to react to rising signals and slow to decay… the problems I have is trying to get a smooth evelope signal with few discontinuities since a short attack time equates to sudden increases in the envelope when it is decaying. Trying to use a low pass filter to get rid of these bumps ends up affecting the response time… etc. Anywho comments suggestions… would greatly be appreciated.


February 6, 2007 | 11:20 am

Hi,
For detection of percussive sounds, you might put the RMS values into a
bucket object and make a test with multiple conditions in the if object on
several past values.
One thing I did successfully was to detect that there is a maximum by
checking that the last value was lower than the previous one, itself higher
than the previous one, itself higher than the previous one, etc. It is your
choice and tweaking to define how many previous values you take into
account, depending on the nature of the percussive signal and on the vector
size.
There is an added latency for waiting one vector after the maximum to make
sure it was a maximum, but if vector size is small, it is not a problem.
And, at least, you are measuring the real maximum level of the impact.
Additional test conditions on absolute and relative thresholds condition
prevent false triggering.

Best,
Todor
>
> Since i’ve seen this topic a million times discussed on this forum and I’ve
> been overcome with the urge to discuss it… here it is.
>
> There are so many different ways to create envelope followers in MSP. Slide,
> rampsmooth, vectral, deltaclip, low pass filters etc. Now I want to here what
> people have to comment on the affectiveness of using each for a particular
> application. One thing I’ve been working on some time is envelope following
> percusive signals. This requires a signal network that is quick to react to
> rising signals and slow to decay… the problems I have is trying to get a
> smooth evelope signal with few discontinuities since a short attack time
> equates to sudden increases in the envelope when it is decaying. Trying to
> use a low pass filter to get rid of these bumps ends up affecting the response
> time… etc. Anywho comments suggestions… would greatly be appreciated.
>
>
>


February 6, 2007 | 11:31 am

Quote: Tyler Nitsch wrote on Mon, 05 February 2007 22:26
—————————————————-
> There are so many different ways to create envelope followers in MSP. Slide, rampsmooth, vectral, deltaclip, low pass filters etc. —————————————————-

i like slide, and rampsmooth especially if you want to smooth out the decay more than the attack – they have independent smooth values, which (IMO) is very useful for percussive sounds.

j


February 6, 2007 | 1:27 pm


February 7, 2007 | 10:02 pm

This compressor should be easy to adapt to act like an envelope follower. It uses rampsmooth.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 206 275 46 9109513 bypass;
#P toggle 189 275 15 0;
#P newex 29 246 31 9109513 + 1;
#P newex 111 275 73 9109513 selector~ 2 1;
#P newex 29 275 73 9109513 selector~ 2 1;
#P message 90 55 33 9109513 loop 1;
#P user ezdac~ 28 310 72 343 0;
#P toggle 19 34 15 0;
#P message 36 34 28 9109513 open;
#N sfplay~ 2 120960 0 ;
#P newobj 19 55 58 9109513 sfplay~ 2;
#P newex 226 108 79 9109513 t 5 200 0.1 6 2.;
#P newex 226 86 52 9109513 loadbang;
#P flonum 139 171 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 176 171 80 9109513 makeup gain;
#P flonum 126 152 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 163 152 80 9109513 ratio;
#P flonum 113 133 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 150 133 80 9109513 threshold (0 – 1);
#P flonum 100 113 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 137 113 80 9109513 release (ms);
#P flonum 87 93 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 635 335 1069 715;
#P window setfont "Sans Serif" 9.;
#P newex 56 104 34 9109513 /~ 2.;
#P newex 56 85 27 9109513 +~;
#P newex 37 248 53 9109513 gate~ 2 1;
#P newex 79 268 35 9109513 *~ 1.;
#P newex 37 298 35 9109513 *~ 1.;
#N comlet (signal) Out L;
#P outlet 37 320 15 0;
#N comlet (signal) In L;
#P inlet 39 41 15 0;
#P newex 353 201 29 9109513 * 0.;
#P newex 353 182 29 9109513 t b f;
#P newex 353 144 31 9109513 !/ 1.;
#P newex 353 163 30 9109513 !- 1.;
#N comlet (float) release;
#P inlet 201 41 15 0;
#P newex 201 60 94 9109513 prepend rampdown;
#P newex 114 60 81 9109513 prepend rampup;
#P newex 114 228 34 9109513 +~ 1.;
#P newex 114 248 53 9109513 gate~ 2 1;
#P newex 114 208 39 9109513 >~ 0.2;
#P newex 283 221 40 9109513 +~ 0.2;
#P newex 256 241 37 9109513 !/~ 1.;
#P newex 283 201 34 9109513 /~ 3.;
#P newex 114 147 125 9109513 rampsmooth~ 1000 1000;
#P newex 156 268 35 9109513 *~ 1.;
#P newex 56 123 31 9109513 abs~;
#P newex 114 298 35 9109513 *~ 1.;
#N comlet (float) treshold;
#P inlet 314 41 15 0;
#N comlet (float) makeup gain;
#P inlet 378 41 15 0;
#N comlet (signal) In R;
#P inlet 73 41 15 0;
#N comlet (float , ms) attack;
#P inlet 114 41 15 0;
#N comlet (float) ratio;
#P inlet 353 41 15 0;
#N comlet (signal) Out R;
#P outlet 114 320 15 0;
#P connect 15 0 27 0;
#P connect 26 0 25 0;
#P connect 27 0 25 0;
#P connect 25 0 24 0;
#P connect 23 0 28 0;
#P connect 28 0 29 0;
#P connect 29 0 7 0;
#P fasten 4 0 25 1 383 296 67 296;
#P connect 3 0 28 1;
#P connect 27 1 26 0;
#P connect 23 0 27 1;
#P connect 11 0 26 1;
#P connect 2 0 16 0;
#P connect 17 0 9 0;
#P connect 16 0 9 0;
#P connect 7 0 9 0;
#P connect 9 0 13 0;
#P connect 13 0 15 0;
#P connect 15 0 14 0;
#P connect 14 0 6 0;
#P connect 8 0 6 0;
#P connect 6 0 0 0;
#P fasten 4 0 6 1 383 296 144 296;
#P connect 5 0 13 1;
#P connect 14 1 8 0;
#P connect 3 0 14 1;
#P connect 11 0 8 1;
#P connect 18 0 17 0;
#P connect 9 0 11 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 11 1;
#P connect 1 0 10 1;
#P connect 22 0 12 1;
#P connect 1 0 20 0;
#P connect 20 0 19 0;
#P connect 19 0 21 0;
#P connect 21 0 22 0;
#P connect 5 0 22 0;
#P connect 21 1 22 1;
#P pop;
#P newobj 61 189 92 9109513 p compressor;
#P comment 124 93 55 9109513 attack (ms);
#P fasten 13 1 1 1 48 174 79 174;
#P fasten 13 1 19 2 48 269 178 269;
#P fasten 13 0 1 0 24 177 66 177;
#P fasten 13 0 18 2 24 272 96 272;
#P connect 20 0 18 0;
#P connect 20 0 19 0;
#P connect 12 4 10 0;
#P connect 12 3 8 0;
#P connect 12 2 6 0;
#P connect 12 1 4 0;
#P connect 12 0 2 0;
#P connect 11 0 12 0;
#P connect 21 0 20 0;
#P connect 19 0 16 1;
#P connect 1 1 19 1;
#P connect 18 0 16 0;
#P connect 1 0 18 1;
#P connect 17 0 13 1;
#P connect 15 0 13 0;
#P connect 14 0 13 0;
#P connect 10 0 1 6;
#P connect 6 0 1 4;
#P connect 8 0 1 5;
#P connect 4 0 1 3;
#P connect 2 0 1 2;
#P window clipboard copycount 23;

Cheers,
Mattijs


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