Two quick MSP questions

codysherman's icon

1. What is the best way to convert stereo into mono? I just drag them both into a "*~ 1." which seems to do the trick but I feel like thats not how it should work and I'm just sorta forcing the two together incorrectly. (See example below)

2. What is the best way to turn a signal into the float/decimal of its volume. Currently I have it go into a "meter~" then taking connecting to the output of that. But if the meter won't be seen, isn't it just wasted CPU displaying it?

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

Here is an example showing my two questions:

Floating Point's icon

1. is perfectly OK-- it's the same as using a [+~] object

2. depends on what you want to do, but a more efficient way would be to use [snapshot~], where you can change the polling interval and not have a UI display. You might want to also look at [average~] also

T

codysherman's icon

Thanks so much for the help!

codysherman's icon

Hmmm after doing some testing, using the meter~ seems to work better results-wise. I'm having trouble getting snapshot~ to match it. If I set snapshot to 50 ms just as meter, it tends to be a lot shakier, I'm not sure if this has to do with not converting snapshot over the decibel system or what.

codysherman's icon

Ok so I've found that peakamp~ is the best replacement for meter~. It seems to put out the exact same results.

Chris Muir's icon

The best envelope follower I know of in Max/MSP is also one of the most expensive, from a CPU cycle POV: Miller Puckette's fiddle~

Alexis Baskind's icon

To calculate the envelope I use the standard RMS definition and it just works fine:

. square root of the signal (use *~ with the same signal at both inlets)
. first-order low-pass filter with a time constant between 20ms and 200ms the latter roughly corresponds to the VU-meter standard)
. snapshot~ with a period equal to a third or a half of the time constant
. atodb to output the result in dB
. / 2. to do the square root in the dB domain

Alexis

halflifebe's icon

@ codysherman

how can I download the patches written like yours in this forum?

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

(sorry but I m new in this forum)

Roman Thilenius's icon

[meter~] indeed needs CPU even if not seen, but [snapshot~] is also not cost-free.

i always use a meter~ object and downsample it using [poly~ mymeterpatch~ down 8]

and 50 ms is just fine for a GUI.

about "to mono" ... you add signals in msp by just running them in the same input - whereever.
so +~ is a waste. try with dac~.

newfuturenow's icon

halflifebe
Copy everything inc' the footer and the header like the example above and in max in the toolbar > file > copy from clipboard.