live.gain~ "Amplitude of every channel"

Alo Faro's icon

Hi everyone !

Probably a simple question but I feel a bit stuck...

I would like to remove live.gain~from my patch since the graphical part of live.gain~isn't useful to me there, I'm using it only to get the amplitude of every channel...

I tried with scale~ and snapshot~ but I can't obtain identical numbers...

Thanks !

Jean-Francois Charles's icon

If you want to set the amplitude, you could use [gain~], or [dbtoa] then [line~] and [*~].

Max Patch
Copy patch and select New From Clipboard in Max.

Alo Faro's icon

Hi Jean-charles !

Thanks for your help ! I actually I don't want to modify the amplitude of the incoming signal, it will stay at 0dB, I want to get the same values as ones I could get at the live.gain~output ( linear amplitude of every channel) on the GIF I posted above.

Jean-Francois Charles's icon

I see, you could try peakamp~:

Max Patch
Copy patch and select New From Clipboard in Max.

florian1947's icon

It seems that live.gain~ approximates peak-meter characteristics, using a slower return than attack time.
Whereas [peakamp~] and [snapshot~] give almost identical, and likely more accurate, results.

Max Patch
Copy patch and select New From Clipboard in Max.




Alo Faro's icon

Thanks guys !

I tried to make a little patch to observe minimum and maximum values, if I'm right the most accurate solution have higher and lower values. Am I right ?

It looks like results depend on used material.

I'm not sure what solution I should choose to be close as possible to True Peak values we can read above the Live meters...

The closer solution seems to be the one using peakamp~ but sometimes lower values are higher than with live.gain~ which make me ask "Is the peakamp~ solution more accurate than the live.gain~ solution ?"

Again, thanks for feeding the thread ! I hope I don't annoy anyone !

Max Patch
Copy patch and select New From Clipboard in Max.

Jean-Francois Charles's icon

peakamp~ is going to give you the peak amplitude in the last 10 ms (period you're using) (no need for abs~)
snapshot~ is giving you the value of one sample, the one that's hit when you bang it (say, the first one in the signal vector currently processed) abs~ just makes it positive, but you don't get a peak.
Just replace [+~][peakamp~] by just [+] (no tilde): you are not working with signal at this point.

Alo Faro's icon

Thanks Jean-François !