summaryrefslogtreecommitdiff
path: root/opcodes/spdist.xml
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2014-01-24 13:54:37 -0300
committerFelipe Sateler <fsateler@debian.org>2014-01-24 13:54:37 -0300
commitbcf06a42deb371baf3deb9f4addb474b08273120 (patch)
tree4a8c3fb811dd164d4486628d8eff6043ebe8a6c3 /opcodes/spdist.xml
parent3a91171181113761a14bcc36a086a8dda144b77b (diff)
Imported Upstream version 6.02~dfsg
Diffstat (limited to 'opcodes/spdist.xml')
-rw-r--r--opcodes/spdist.xml93
1 files changed, 8 insertions, 85 deletions
diff --git a/opcodes/spdist.xml b/opcodes/spdist.xml
index 84b2665..4226de0 100644
--- a/opcodes/spdist.xml
+++ b/opcodes/spdist.xml
@@ -122,95 +122,18 @@
<emphasis>kx, ky</emphasis> -- when <emphasis>ifn</emphasis> is 0, <emphasis>space</emphasis> and <emphasis>spdist</emphasis> will use these values as the XY coordinates to localize the signal.
</para>
</refsect1>
-
+
<refsect1>
<title>Examples</title>
<para>
- <informalexample>
- <programlisting>
-<emphasis role="oblock">instr</emphasis> 1
- asig <emphasis role="comment">;some audio signal</emphasis>
- ktime <emphasis role="opc">line</emphasis> 0, p3, p10
- a1, a2, a3, a4 <emphasis role="opc">space</emphasis> asig,1, ktime, .1
- ar1, ar2, ar3, ar4 <emphasis role="opc">spsend</emphasis>
-
- ga1 <emphasis role="op">=</emphasis> ga1<emphasis role="op">+</emphasis>ar1
- ga2 <emphasis role="op">=</emphasis> ga2<emphasis role="op">+</emphasis>ar2
- ga3 <emphasis role="op">=</emphasis> ga3<emphasis role="op">+</emphasis>ar3
- ga4 <emphasis role="op">=</emphasis> ga4<emphasis role="op">+</emphasis>ar4
-
- <emphasis role="op">outq</emphasis> a1, a2, a3, a4
-<emphasis role="oblock">endin</emphasis>
-
-<emphasis role="oblock">instr</emphasis> 99 <emphasis role="comment">; reverb instrument</emphasis>
-
- a1 <emphasis role="opc">reverb2</emphasis> ga1, 2.5, .5
- a2 <emphasis role="opc">reverb2</emphasis> ga2, 2.5, .5
- a3 <emphasis role="opc">reverb2</emphasis> ga3, 2.5, .5
- a4 <emphasis role="opc">reverb2</emphasis> ga4, 2.5, .5
-
- <emphasis>outq</emphasis> a1, a2, a3, a4
- ga1 <emphasis role="op">=</emphasis>0
- ga2 <emphasis role="op">=</emphasis>0
- ga3 <emphasis role="op">=</emphasis>0
- ga4 <emphasis role="op">=</emphasis>0
-<emphasis role="oblock">endin</emphasis></programlisting>
- </informalexample>
- </para>
-
- <para>
- In the above example, the signal, <emphasis>asig</emphasis>, is moved according to the data in Function #1 indexed by <emphasis>ktime</emphasis>. <emphasis>space</emphasis> sends the appropriate amount of the signal internally to <emphasis>spsend</emphasis>. The outputs of the <emphasis>spsend</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>space</emphasis> can be 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 using xy values from the score instead of a function table.
- <informalexample>
- <programlisting>
-<emphasis role="oblock">instr</emphasis> 1
- ...
- a1, a2, a3, a4 <emphasis role="opc">space</emphasis> asig, 0, 0, .1, p4, p5
- ar1, ar2, ar3, ar4 <emphasis role="opc">spsend
- </emphasis>
- ga1 <emphasis role="op">=</emphasis> ga1<emphasis role="op">+</emphasis>ar1
- ga2 <emphasis role="op">=</emphasis> ga2<emphasis role="op">+</emphasis>ar2
- <emphasis role="opc">outs</emphasis> a1, a2
-<emphasis role="oblock">endin</emphasis>
-
-<emphasis role="oblock">instr</emphasis> 99 <emphasis role="comment">; reverb....</emphasis>
- ....
-<emphasis role="oblock">endin</emphasis></programlisting>
- </informalexample>
- </para>
-
- <para>
- A few notes: p4 and p5 are the x and y values
- <informalexample>
- <programlisting>
- <emphasis role="comment">;place the sound in the left speaker and near</emphasis>
- <emphasis role="stamnt">i</emphasis>1 0 1 -1 1
- <emphasis role="comment">;place the sound in the right speaker and far</emphasis>
- <emphasis role="stamnt">i</emphasis>1 1 1 45 45
- <emphasis role="comment">;place the sound equally between left and right and in the middle ground distance</emphasis>
- <emphasis role="stamnt">i</emphasis>1 2 1 0 12
-<emphasis role="stamnt">e</emphasis></programlisting>
- </informalexample>
- </para>
-
- <para>
- The next example shows a simple intuitive use of the distance values returned by <emphasis>spdist</emphasis> to simulate Doppler shift.
- <informalexample>
- <programlisting>
- ktime <emphasis role="opc">line</emphasis> 0, p3, 10
- kdist <emphasis role="opc">spdist</emphasis> 1, ktime
- kfreq <emphasis role="op">=</emphasis> (ifreq <emphasis role="op">*</emphasis> 340) <emphasis role="op">/</emphasis> (340 <emphasis role="op">+</emphasis> kdist)
- asig <emphasis role="opc">oscili</emphasis> iamp, kfreq, 1
-
- a1, a2, a3, a4 <emphasis role="opc">space</emphasis> asig, 1, ktime, .1
- ar1, ar2, ar3, ar4 <emphasis role="opc">spsend</emphasis></programlisting>
- </informalexample>
+ Here is an example of the spdist opcode. It uses the file <ulink url="examples/spdist.csd"><citetitle>spdist.csd</citetitle></ulink>.
+ <example>
+ <title>Example of the spdist opcode.</title>
+ <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>
+ <xi:include href="examples-xml/spdist.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ </example>
</para>
-
- <para>
+ <para>
The same function and time values are used for both <emphasis>spdist</emphasis> and <emphasis>space</emphasis>. This insures that the distance values used internally in the <emphasis>space</emphasis> unit will be the same as those returned by <emphasis>spdist</emphasis> to give the impression of a Doppler shift!
</para>
</refsect1>