Debian Codegraph @

opcodes/locsig.xml

raw symbols SCIP
1
2 <refentry id="locsig">
3 <indexterm id="IndexLocsig"><primary>locsig</primary></indexterm>
4 <refentryinfo><title>Signal Modifiers:Panning and Spatialization</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>locsig</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>locsig</refname>
11 <refpurpose>
12 Takes an input signal and distributes between 2 or 4 channels.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 <emphasis>locsig</emphasis> takes an input signal and distributes it among 2 or 4 channels using values in degrees to calculate the balance between adjacent channels. It also takes arguments for distance (used to attenuate signals that are to sound as if they are some distance further than the loudspeaker itself), and for the amount the signal that will be sent to reverberators. This unit is based upon the example in the Charles Dodge/Thomas Jerse book, <emphasis>Computer Music</emphasis>, page 320.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>a1, a2 <command>locsig</command> asig, kdegree, kdistance, kreverbsend</synopsis>
26
27 <synopsis>a1, a2, a3, a4 <command>locsig</command> asig, kdegree, kdistance, kreverbsend</synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Performance</title>
32 <para>
33 <emphasis>kdegree</emphasis> -- value between 0 and 360 for placement of the signal in a 2 or 4 channel space configured as: a1=0, a2=90, a3=180, a4=270 (kdegree=45 would balanced the signal equally between a1 and a2). <emphasis>locsig</emphasis> maps <emphasis>kdegree</emphasis> to sin and cos functions to derive the signal balances (e.g.: asig=1, kdegree=45, a1=a2=.707).
34 </para>
35
36 <para>
37 <emphasis>kdistance</emphasis> -- value &gt;= 1 used to attenuate the signal and to calculate reverb level to simulate distance cues. As <emphasis>kdistance</emphasis> gets larger the sound should get softer and somewhat more reverberant (assuming the use of <emphasis>locsend</emphasis> in this case).
38 </para>
39
40 <para>
41 <emphasis>kreverbsend</emphasis> -- the percentage of the direct signal that will be factored along with the distance and degree values to derive signal amounts that can be sent to a reverb unit such as <emphasis>reverb</emphasis>, or <emphasis>reverb2</emphasis>.
42 </para>
43 </refsect1>
44
45 <refsect1>
46 <title>Examples</title>
47 <para>
48 Here is an example of the locsig opcode. It uses the file <ulink url="examples/locsig_quad.csd"><citetitle>locsig_quad.csd</citetitle></ulink>.
49
50 <example>
51 <title>Example of the locsig opcode.</title>
52 <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>
53 <xi:include href="examples-xml/locsig_quad.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
54 </example>
55 </para>
56
57 <para>
58 In the above example, the signal, <emphasis>aout</emphasis>, is sent around a complete circle once during the duration of a note while at the same time it becomes more and more &quot;distant&quot; from the listeners' location. <emphasis>locsig</emphasis> sends the appropriate amount of the signal internally to <emphasis>locsend</emphasis>. The outputs of the <emphasis>locsend</emphasis> are added to global accumulators in a common Csound style and the global signals are used as inputs to the reverb units in a separate instrument.
59 </para>
60
61 <para>
62 <emphasis>locsig</emphasis> is useful for quad and stereo panning as well as fixed placed of sounds anywhere between two loudspeakers. Below is an example of the fixed placement of sounds in a stereo field.
63 </para>
64
65 <para>
66 <informalexample>
67 <programlisting>
68 <emphasis role="oblock">instr</emphasis> 1
69 a1, a2 <emphasis role="opc">locsig</emphasis> asig, p4, p5, .1
70 ar1, ar2 <emphasis role="opc">locsend</emphasis>
71 ga1 <emphasis role="op">=</emphasis> ga1<emphasis role="op">+</emphasis>ar1
72 ga2 <emphasis role="op">=</emphasis> ga2<emphasis role="op">+</emphasis>ar2
73 <emphasis role="opc">outs</emphasis> a1, a
74 <emphasis role="oblock">endin</emphasis>
75 <emphasis role="oblock">instr</emphasis> 99
76 <emphasis role="comment">; reverb....</emphasis>
77 <emphasis role="oblock">endin</emphasis></programlisting>
78 </informalexample>
79 </para>
80
81 <para>
82 A few notes:
83 <informalexample>
84 <programlisting>
85 <emphasis role="comment">;place the sound in the left speaker and near:</emphasis>
86 <emphasis role="stamnt">i</emphasis>1 0 1 0 1
87
88 <emphasis role="comment">;place the sound in the right speaker and far:</emphasis>
89 <emphasis role="stamnt">i</emphasis>1 1 1 90 25
90
91 <emphasis role="comment">;place the sound equally between left and right and in the middle ground distance:</emphasis>
92 <emphasis role="stamnt">i</emphasis>1 2 1 45 12
93 <emphasis role="stamnt">e</emphasis></programlisting>
94 </informalexample>
95 </para>
96
97 <para>
98 The next example shows a simple intuitive use of the distance value to simulate Doppler shift. The same value is used to scale the frequency as is used as the distance input to <emphasis>locsig</emphasis>.
99 <informalexample>
100 <programlisting>
101 kdistance <emphasis role="opc">line</emphasis> 1, p3, 10
102 kfreq <emphasis role="op">=</emphasis> (ifreq <emphasis role="op">*</emphasis> 340) <emphasis role="op">/</emphasis> (340 <emphasis role="op">+</emphasis> kdistance)
103 asig <emphasis role="opc">oscili</emphasis> iamp, kfreq, 1
104 kdegree <emphasis role="opc">line</emphasis> 0, p3, 360
105 a1, a2, a3, a4 <emphasis role="opc">locsig</emphasis> asig, kdegree, kdistance, .1
106 ar1, ar2, ar3, ar4 <emphasis role="opc">locsend</emphasis></programlisting>
107 </informalexample>
108 </para>
109 </refsect1>
110
111 <refsect1>
112 <title>See also</title>
113 <para><link linkend="SigmodPanspatl"><citetitle>Panning and Spatialization: Amplitude spatialization</citetitle></link></para>
114 </refsect1>
115
116 <refsect1>
117 <title>Credits</title>
118 <para>
119 <simplelist>
120 <member>Author: Richard Karpen</member>
121 <member>Seattle, WA USA</member>
122 <member>1998</member>
123 </simplelist>
124 </para>
125
126 <para>New in Csound version 3.48</para>
127 </refsect1>
128 </refentry>