ms2st
Mid-Side to stereo Conversion with a width control.
It is a pure function with no side effects.
The ms2st opcode decodes the MS stereo signal, but it also opens up the possibility to adjust the stereo width for every stereo sound; A stereo file can be encoded, using the st2ms opcode, and then decoded by ms2st. It is then possible to adjust the stereo width.
Syntax
Performance
aleft -- left channel output.
aright -- right channel output.
am -- mid signal input.
as -- side signal input.
kwidth -- stereo width (0 to 1). At 0, no side signal is output, and at 1 no mid signal is present. A value of 0.5 restores a stereo to MS conversion (st2ms) exactly.
Examples
Here is an example of the ms2st opcode. It uses the files ms2st.csd, MSjungle_interleaved.wav, MSjungleMid.wav and MSjungleSide.wav.
In instr 1 of the example, the encoded MS stereo file is interleaved. The left channel of this interleaved signal will be decoded as the M (=Mid) signal. The right channel will be decoded as Left and Right. In instr 2 however, two separate channels are used. The user decides which one will be appointed as the middle signal (M) and the side signal (S).

See also
Panning and Spatialization: Amplitude spatialization
Credits
Author: Victor Lazzarini
April 2021