Stereo Image Munger Audio Unit
Audio Unit, Mac OS 10.4+, Intel or PPC
(Only tested on 10.6. Please let me know if it doesn't work on older versions.)

What It Does

We're used to thinking of stereo in term of a left and a right channel, but it's also possible to represent it as a sum and a difference channel, or what audio engineers call the M ("mid" or "mono") and S ("side" or "stereo") channels. (For you mathematicians, this is just a change of basis in the vector space of stereo.)

It is sometimes desirable to adjust the levels of M and S independently, or even to apply separate processing to these channels. Stereo Image Munger is a small Swiss army knife for this sort of processing.

There are three typical ways of using it:

You can also create novel (if not entirely useful) effects by outputting M/S and leaving it there in the mix, or by outputting odd combinations such as L/S. Inverting channels by setting a negative gain can be fun. Experiment and enjoy.

The Math, and a Warning

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

	L = M + S
	R = M - S

If the input L/R signal does not clip, then the M/S will not clip either. However, be warned: the reverse is not true — you can have M and S both staying below 0dB, and still have L or R jump above it. You have been warned.

Enjoy and use in good health. Patches and suggestions are welcome, though there's no guarantee I'll get to them in a hurry.