| 1 | |
| 2 | <refentry id="MixerReceive"> |
| 3 | <indexterm id="IndexMixerReceive"><primary>MixerReceive</primary></indexterm> |
| 4 | <refentryinfo><title>Mixer Opcodes</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>MixerReceive</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>MixerReceive</refname> |
| 11 | <refpurpose> |
| 12 | Receives an arate signal from a channel of a buss. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para>Receives an arate signal that has been mixed onto a channel of a buss. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis>asignal <command>MixerReceive</command> ibuss, ichannel</synopsis> |
| 25 | </refsect1> |
| 26 | |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Initialization</title> |
| 30 | |
| 31 | <para><emphasis>ibuss</emphasis> -- The number of the buss, for example the number of the instrument receiving the signal.</para> |
| 32 | |
| 33 | <para><emphasis>ichannel</emphasis> -- The number of the channel. Each buss has <literal>nchnls</literal> channels.</para> |
| 34 | </refsect1> |
| 35 | |
| 36 | <refsect1> |
| 37 | <title>Performance</title> |
| 38 | <para><emphasis>asignal</emphasis> -- The signal that has been mixed onto the indicated channel of the buss.</para> |
| 39 | |
| 40 | <para> |
| 41 | Use of the mixer requires that instruments setting gains have smaller numbers than instruments sending signals, |
| 42 | and that instruments sending signals have smaller numbers than instruments receiving those signals. |
| 43 | However, an instrument may have any number of sends or receives. After the final signal is received, |
| 44 | <link linkend="MixerClear"><citetitle>MixerClear</citetitle></link> must be invoked to reset the busses to 0 before the next kperiod. |
| 45 | </para> |
| 46 | </refsect1> |
| 47 | |
| 48 | <refsect1> |
| 49 | <title>Examples</title> |
| 50 | |
| 51 | <programlisting> |
| 52 | <emphasis role="oblock">instr</emphasis> 220 <emphasis role="comment">; Master output</emphasis> |
| 53 | <emphasis role="comment">; It applies a bass enhancement, compression and fadeout</emphasis> |
| 54 | <emphasis role="comment">; to the whole piece, outputs signals, and clears the mixer.</emphasis> |
| 55 | a1 <emphasis role="opc">MixerReceive</emphasis> 220, 0 |
| 56 | a2 <emphasis role="opc">MixerReceive</emphasis> 220, 1 |
| 57 | <emphasis role="comment">; Bass enhancement</emphasis> |
| 58 | al1 <emphasis role="opc">butterlp</emphasis> a1, 100 |
| 59 | al2 <emphasis role="opc">butterlp</emphasis> a2, 100 |
| 60 | a1 <emphasis role="op">=</emphasis> al1<emphasis role="op">*</emphasis>1.5 <emphasis role="op">+</emphasis> a1 |
| 61 | a2 <emphasis role="op">=</emphasis> al2<emphasis role="op">*</emphasis>1.5 <emphasis role="op">+</emphasis> a2 |
| 62 | |
| 63 | <emphasis role="comment">; Global amplitude shape</emphasis> |
| 64 | kenv <emphasis role="opc">linseg</emphasis> 0., p5 <emphasis role="op">/</emphasis> 2.0, p4, p3 <emphasis role="op">-</emphasis> p5, p4, p5 <emphasis role="op">/</emphasis> 2.0, 0. |
| 65 | a1<emphasis role="op">=</emphasis>a1<emphasis role="op">*</emphasis>kenv |
| 66 | a2<emphasis role="op">=</emphasis>a2<emphasis role="op">*</emphasis>kenv |
| 67 | |
| 68 | <emphasis role="comment">; Compression</emphasis> |
| 69 | a1 <emphasis role="opc">dam</emphasis> a1, 5000, 0.5, 1, 0.2, 0.1 |
| 70 | a2 <emphasis role="opc">dam</emphasis> a2, 5000, 0.5, 1, 0.2, 0.1 |
| 71 | |
| 72 | <emphasis role="comment">; Remove DC bias</emphasis> |
| 73 | a1blocked <emphasis role="opc">dcblock</emphasis> a1 |
| 74 | a2blocked <emphasis role="opc">dcblock</emphasis> a2 |
| 75 | |
| 76 | <emphasis role="comment">; Output signals</emphasis> |
| 77 | <emphasis role="opc">outs</emphasis> a1blocked, a2blocked |
| 78 | <emphasis role="opc">MixerClear</emphasis> |
| 79 | <emphasis role="oblock">endin</emphasis></programlisting> |
| 80 | <para> |
| 81 | Here is a complete example of the MixerReceive opcode. It uses the file <ulink url="examples/Mixer.csd"><citetitle>Mixer.csd</citetitle></ulink> |
| 82 | <example> |
| 83 | <title>Complete example of the MixerReceive opcode.</title> |
| 84 | <xi:include href="examples-xml/Mixer.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 85 | </example> |
| 86 | </para> |
| 87 | </refsect1> |
| 88 | |
| 89 | <refsect1> |
| 90 | <title>See also</title> |
| 91 | <para><link linkend="MixerOpcodes"><citetitle>Mixer Opcodes</citetitle></link></para> |
| 92 | </refsect1> |
| 93 | |
| 94 | <refsect1> |
| 95 | <title>Credits</title> |
| 96 | <para>Michael Gogins (gogins at pipeline dot com).</para> |
| 97 | </refsect1> |
| 98 | </refentry> |