summaryrefslogtreecommitdiff
path: root/opcodes/locsend.xml
blob: b75508d73fb5133ab3a1fa66dd01962ede302bdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<refentry id="locsend">
<indexterm id="IndexLocsend"><primary>locsend</primary></indexterm>
  <refentryinfo><title>Signal Modifiers:Panning and Spatialization</title></refentryinfo>
  <refmeta>
    <refentrytitle>locsend</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>locsend</refname>
    <refpurpose>
      Distributes the audio signals of a previous <emphasis>locsig</emphasis> opcode.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>locsend</emphasis> depends upon the existence of a previously defined <link linkend="locsig"><citetitle>locsig</citetitle></link>. The number of output signals must match the number in the previous <emphasis>locsig</emphasis>. The output signals from <emphasis>locsend</emphasis> are derived from the values given for distance and reverb in the <emphasis>locsig</emphasis> and are ready to be sent to local or global reverb units (see example below). The reverb amount and the balance between the 2 or 4 channels are calculated in the same way as described in the Dodge book (an essential text!).
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>a1, a2 <command>locsend</command></synopsis>

    <synopsis>a1, a2,  a3, a4 <command>locsend</command></synopsis>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      <informalexample>
        <programlisting>
  asig some audio signal
  kdegree            <emphasis>line</emphasis>    0, p3, 360
  kdistance          <emphasis>line</emphasis>    1, p3, 10
  a1, a2, a3, a4     <emphasis>locsig</emphasis>  asig, kdegree, kdistance, .1
  ar1, ar2, ar3, ar4 <emphasis>locsend</emphasis>
  ga1 = ga1+ar1
  ga2 = ga2+ar2
  ga3 = ga3+ar3
  ga4 = ga4+ar4
                     <emphasis>outq</emphasis>    a1, a2, a3, a4
<emphasis>endin</emphasis>

<emphasis>instr</emphasis> 99 ; reverb instrument
  a1                 <emphasis>reverb2</emphasis> ga1, 2.5, .5
  a2                 <emphasis>reverb2</emphasis> ga2, 2.5, .5
  a3                 <emphasis>reverb2</emphasis> ga3, 2.5, .5
  a4                 <emphasis>reverb2</emphasis> ga4, 2.5, .5
                     <emphasis>outq</emphasis>    a1, a2, a3, a4
  ga1=0
  ga2=0
  ga3=0
  ga4=0
        </programlisting>
      </informalexample>
    </para>

    <para>
      In the above example, the signal, <emphasis>asig</emphasis>, is sent around a complete circle once during the duration of a note while at the same time it becomes more and more <quote>distant</quote> 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.
    </para>

    <para>
      <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.
    </para>

    <para>
      <informalexample>
        <programlisting>
<emphasis>instr</emphasis> 1
  a1, a2             <emphasis>locsig</emphasis>  asig, p4, p5, .1
  ar1, ar2           <emphasis>locsend</emphasis>
  ga1=ga1+ar1
  ga2=ga2+ar2
                     <emphasis>outs</emphasis> a1, a
<emphasis>endin
instr</emphasis> 99 
  ; reverb....
<emphasis>endin</emphasis>
        </programlisting>
      </informalexample>
    </para>

    <para>
      A few notes:
      <informalexample>
        <programlisting>
  ;place the sound in the left speaker and near:
  i1 0 1 0 1
  
  ;place the sound in the right speaker and far:
  i1 1 1 90 25
  
  ;place the sound equally between left and right and in the middle ground distance:
  i1 2 1 45 12
  e
        </programlisting>
      </informalexample>
    </para>

    <para>
      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>.
      <informalexample>
        <programlisting>
  kdistance          <emphasis>line</emphasis>    1, p3, 10
  kfreq = (ifreq * 340) / (340 + kdistance)
  asig               <emphasis>oscili</emphasis>  iamp, kfreq, 1
  kdegree            <emphasis>line</emphasis>    0, p3, 360
  a1, a2, a3, a4     <emphasis>locsig</emphasis>  asig, kdegree, kdistance, .1
  ar1, ar2, ar3, ar4 <emphasis>locsend</emphasis>
        </programlisting>
      </informalexample>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="locsig"><citetitle>locsig</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Richard Karpen</member>
        <member>Seattle, WA USA</member>
        <member>1998</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.48</para>
  </refsect1>
</refentry>