Mid Side processor in Max MSP

Wojciech Morawski's icon

Hi :)

Did you know how to extract mid and side from stereo signal?

Thanks!

Tim Lloyd's icon

Mid = L+R
Side = L-R

:)

Morgan's icon

Mid = L+R
Sides = L-R & R-L

Orkester's icon

On a side note, by what factor should I scale the side audio by to account for the perceived difference in gain?

t's icon

check the patch for scaling...

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

LR to MS patch:

Orkester's icon

Much appreciated.

Roman Thilenius's icon

"Side = L-R"

yeah, you wish. :)

t's icon

"yeah, you wish. :)"

if you don't believe that side=L-R, download this http://www.brainworx-music.de/en/plugins/bx_solo free plugin from Brainworks and compare the results. or if you use Live, you can do LR to MS transformation with two utilities and an effect rack. set the stereo width (maybe it's called otherwise) parameter of one utility to 0% (Mid or mono) and the other to 200% (sides)...

Tim Lloyd's icon

Well it does Roman ... unless you have a better way? If you do, please do tell us :)

Roman Thilenius's icon

somebody posted one here for me about two years ago ... but i cant find it now.
mid/side means mono and not-mono ... this can only be done by phase, -~
will do nothing. :)

start with the "mid" and you will see what i mean. how would you get the mid channel?

Floating Point's icon

to be pedantic:
by definition:
L=M+S;
R=M-S;

therefore M=(L+R)/2
and S=(L-R)/2

Roman Thilenius's icon

morgan is closer:

"Mid = L+R
Sides = L-R & R-L"

he at least knows that "side" is two channels. ^^

Tim Lloyd's icon

Subtracting L from R is the same as adding L to a polarity-inverted R. Yes, it is to do with phase, but only regarding a 180degree shift for all frequencies, which is the same as a polarity inversion, which is the same as multiplying an audio stream by -1, hence just subtracting them does work ... no?

The only similar kind of matrix that I know of is the Gerzon 2-3 matrix, which attempts to separate stereo l/r into 3-channel mid/left/right. It uses ms encoding/decoding, but it isn't the same.

"Side" is only two channels when it is mixed with the mid signal (even though that still doesn't make sense :p ) ... have you ever use an m/s mic array? It's the exact same concept, the "side" signal comes from a bidirectional microphone because the two lobes of the polar pattern are mechanically 180degrees out of phase with each other (opposite polarity).

Floating Point's icon

side is _not_ two channels-- side is single signal coming from a figure of 8 directionality pattern -- people can confuse the two lobes as being two separate signals; it is not

Tim Lloyd's icon

Yes, Terry's first post is exactly it and what I should have posted in the first place.

Roman Thilenius's icon

"Subtracting L from R is the same as adding L to a polarity-inverted R"

might be, but S- is M-R and and S+ is M-L, and you dont know M yet. :)

and even if S- and S+ is only one channel in some application, the side can
never be R-L ... because both sides would be (R-L)+(R-L) from what you say ... hehehe :D

and mid is not the same as mono, mid is _not L+R.

Tim Lloyd's icon

"might be, but S- is M-R and and S+ is M-L, and you dont know M yet. :)"

You don't need to know M to find S ... as Terry posted:

M=(L+R)/2
S=(L-R)/2

... you can disagree all you like, but it does work :)

Post a patch that proves the above doesn't work if you like.

Roman Thilenius's icon

i dont see how L+R=M.

the sum of L and R still contain everything what is different between
L and R, except parts which are 100% out of phase (which almost never
happens in a piece of music.)

ok when you say it work, show me your patch and i will see if it works :D
(pls keep in mind that i am a max4 idiot, i need a max5 attachement or picture
for aminimum of "compatibilty")

Roman Thilenius's icon

aha.

i have now checked that old patch i had made and in fact i was wrong and i now also know why.

what i once was building is a custom 3 channel format which is able to split LR into "LMR"
which gave more control of how to distiguish between mono and stereo material in the
mix. it is built completely different from that M/S industry standard, which i am a bit
suprised about now that is seems to be nothing special - mine is so much better. :D

but still show me the "working" patch pls.

Wojciech Morawski's icon

Thank you for all your answer :)
I also would like to see working patch, and I've got some more questions:

Do you know some sound processing techniques especially dedicated for M/S which are more complicated than playing with loudness and Eq? For example mentioned brainworx M/S plugin is really awesome. Do you know what it does with side signal?

Thanks!
wo

Floating Point's icon

I have no idea what they do with their MS algorithms-- maybe as a total guess they make the mid bassier or something. I'm not at all familiar with their plugins.

to quote brainworx own marketing:

"bx_meter is not the tool that will automatically make your mixes sound better, of course, but it will give you some insight in what you are doing when you are mixing or mastering, and understanding the correlation of dynamics, M/S, phase and levels by listening to your music will help you mix / master better."

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

In other words all ms processing really allows you to do is change the stereo spread as implemented in this patch: (of course you can do anything you like with the M and S signals before re-encoding into stereo, but that's up to you)

Roman Thilenius's icon

so it seems that not only my confusion had to be sorted (so that i can stop beeing a dickhead),
there was another suprise for me.

i have a set of abstractions called "space" ... encoder, decoder, utilities ... which seem to do
what this "normal" LR to M/S also does.
quite shocking that i had to discover that it is such a simple thing.

about compressor plug-ins: i dont think they do anythign special. just have a dynamic effect
on M and S. there is one thing what is important: if you do anything with lookup or delay
or things like that, always have the effect enabled on both channels, just with different settings.
dependign on the effect you are biulding, you might othewise run into a trap where M is delayed
and S is not - with the result that decoding back L and R will fail.

the attached picture shows how my basic imager effect works (i often use this in effects or
generators), and (as it seems) it is basically MS encoding, balancing and panning, and MS
decoding.

-110

2532.spacemodimager.jpg
jpg
Roman Thilenius's icon

"Do you know some sound processing techniques especially dedicated for M/S which are more complicated than playing with loudness and Eq? For example mentioned brainworx M/S plugin is really awesome. Do you know what it does with side signal?"

definetly a limiter or gate are just as cool as compressors, but it can be fun with reverb, too.

Roman Thilenius's icon

... or a classic: lower the sub bass volume of the sides and raise it likewise for the center.

eliott paris's icon

I've made a simple external for Middle/Side Processing according to this post.
Maybe it could be usefull for someone.

2548.ep.MidSide.zip
zip