keep maximum~

frank desben's icon

Hi all,
I got two question that might be easy for some of you, but it's been giving me a headache, and I couldn't find a thread on it in the forum.

How can I have a patch, that keeps the maximum of an audio signal stream (not like maximum~ comparing 2 values). I kind of managed to do that - but then I had trouble being able to reset the maximum value to 0 again.

Thank you!!!!
Frank

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Something like this, perhaps?

frank desben's icon

Hi Christopher,
yes, basically like this, but in the audio domain, if possible.
Thanks a lot though!
Best
Frank

Christopher Dobrian's icon

Do you really require updating on every single sample? If so, my first question would be "Why?" But if you do, that would mean that every output sample y would depend on the previous output sample y-1, which implies that you'd either need a signal vector size of 1 (inefficient) or that the process would have to take place within a single msp~ object (written in C or Java). However, if you don't really require an update every sample, set the time interval of peakamp~ to the update time you do need, then send the output to a sig~ object (or smooth it with a line~ object, or curve~, or rampsmooth~) to get it back into the MSP audio signal world.

Roald Baudoux's icon

Isn't minmax~ what you are looking for ?

frank desben's icon

Hi Roald,
that was exactly what I was looking for!!
Thanks!
Frank

Christopher Dobrian's icon

Voilà. J'avais oublié celui-là. :) -C