| 1 | <refentry id="ms2st"> |
| 2 | <indexterm id="IndexMs2st"><primary>ms2st</primary></indexterm> |
| 3 | <refentryinfo><title>Signal Modifiers:Panning and Spatialization </title></refentryinfo> |
| 4 | <refmeta> |
| 5 | <refentrytitle>ms2st</refentrytitle> |
| 6 | </refmeta> |
| 7 | <refnamediv> |
| 8 | <refname>ms2st</refname> |
| 9 | <refpurpose> |
| 10 | Mid-Side to stereo Conversion. |
| 11 | </refpurpose> |
| 12 | </refnamediv> |
| 13 | |
| 14 | <refsect1> |
| 15 | <title>Description</title> |
| 16 | <para> |
| 17 | This opcode implements mid-side (MS) to stereo conversion with a |
| 18 | width control. It is |
| 19 | a pure function with no side effects. |
| 20 | </para> |
| 21 | <para> |
| 22 | The ms2st opcode decodes the MS stereo signal, but it also opens up the possibility to adjust the stereo width for <emphasis>every</emphasis> stereo sound; |
| 23 | A stereo file can be encoded, using the st2ms opcode, and then decoded by ms2st. |
| 24 | It is then possible to adjust the stereo width. |
| 25 | </para> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Syntax</title> |
| 30 | <synopsis>aleft,aright <command>ms2st</command> am, as, kwidth</synopsis> |
| 31 | </refsect1> |
| 32 | |
| 33 | |
| 34 | <refsect1> |
| 35 | <title>Performance</title> |
| 36 | <para> |
| 37 | <emphasis>aleft</emphasis> -- left channel output. |
| 38 | </para> |
| 39 | <para> |
| 40 | <emphasis>aright</emphasis> -- right channel output. |
| 41 | </para> |
| 42 | <para> |
| 43 | <emphasis>am</emphasis> -- mid signal input. |
| 44 | </para> |
| 45 | <para> |
| 46 | <emphasis>as</emphasis> -- side signal input. |
| 47 | </para> |
| 48 | <para> |
| 49 | <emphasis>kwidth</emphasis> -- stereo width (0 to 1). At 0, no side |
| 50 | signal is output, and at 1 no mid signal is present. A value of |
| 51 | 0.5 restores a stereo to MS conversion (st2ms) exactly. |
| 52 | </para> |
| 53 | </refsect1> |
| 54 | <refsect1> |
| 55 | <title>Examples</title> |
| 56 | <para> |
| 57 | Here is an example of the ms2st opcode. It uses the files <ulink url="examples/ms2st.csd"><citetitle>ms2st.csd</citetitle></ulink>, <ulink url="examples/MSjungle_interleaved.wav"><citetitle>MSjungle_interleaved.wav</citetitle></ulink>, <ulink url="examples/MSjungleMid.wav"><citetitle>MSjungleMid.wav</citetitle></ulink> and <ulink url="examples/MSjungleSide.wav"><citetitle>MSjungleSide.wav</citetitle></ulink>. |
| 58 | <example> |
| 59 | <title>Example of the ms2st opcode.</title> |
| 60 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 61 | <xi:include href="examples-xml/ms2st.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 62 | </example> |
| 63 | </para> |
| 64 | </refsect1> |
| 65 | |
| 66 | <para> |
| 67 | 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. |
| 68 | The right channel will be decoded as Left and Right. In instr 2 however, two separate channels are used. |
| 69 | The user decides which one will be appointed as the middle signal (M) and the side signal (S). |
| 70 | </para> |
| 71 | <mediaobject> |
| 72 | <imageobject> |
| 73 | <imagedata fileref="images/MS.png" format="PNG"/> |
| 74 | </imageobject> |
| 75 | |
| 76 | <textobject> |
| 77 | <phrase>on top the interleaved encoded MS file (instr 1), at the bottom are the two separate files (instr 2)</phrase> |
| 78 | </textobject> |
| 79 | |
| 80 | <caption> |
| 81 | <para>on top the interleaved encoded MS file (instr 1), at the bottom are the two separate files (instr 2)</para> |
| 82 | </caption> |
| 83 | </mediaobject> |
| 84 | |
| 85 | <refsect1> |
| 86 | <title>See also</title> |
| 87 | <para><link linkend="SigmodPanspatl"><citetitle>Panning and Spatialization: Amplitude spatialization</citetitle></link></para> |
| 88 | </refsect1> |
| 89 | |
| 90 | <refsect1> |
| 91 | <title>Credits</title> |
| 92 | <para> |
| 93 | <simplelist> |
| 94 | <member>Author: &namevictor;</member> |
| 95 | <member>April 2021</member> |
| 96 | </simplelist> |
| 97 | </para> |
| 98 | </refsect1> |
| 99 | </refentry> |