<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>spsend</title> <link rel="stylesheet" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="splitrig.html" title="splitrig" /> <link rel="next" href="sprintf.html" title="sprintf" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">spsend</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="splitrig.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="sprintf.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="spsend"> <a id="spsend"></a> <div class="titlepage"></div> <a id="IndexSpsend" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">spsend</span> </h2> <p>spsend — Generates output signals based on a previously defined <span class="emphasis"><em>space</em></span> opcode. </p> </div> <div class="refsect1" title="Description"> <a id="id3233651"></a> <h2>Description</h2> <p> <span class="emphasis"><em>spsend</em></span> depends upon the existence of a previously defined <a class="link" href="space.html" title="space"><em class="citetitle">space</em></a>. The output signals from <span class="emphasis"><em>spsend</em></span> are derived from the values given for xy and reverb in the <span class="emphasis"><em>space</em></span> and are ready to be sent to local or global reverb units (see example below). </p> </div> <div class="refsect1" title="Syntax"> <a id="id3233682"></a> <h2>Syntax</h2> <pre class="synopsis">a1, a2, a3, a4 <span class="command"><strong>spsend</strong></span></pre> </div> <div class="refsect1" title="Performance"> <a id="id3233699"></a> <h2>Performance</h2> <p> The configuration of the xy coordinates in space places the signal in the following way: </p> <div class="itemizedlist"> <ul class="itemizedlist" type="disc"> <li class="listitem"> <p>a1 is -1, 1</p> </li> <li class="listitem"> <p>a2 is 1, 1</p> </li> <li class="listitem"> <p>a3 is -1, -1</p> </li> <li class="listitem"> <p>a4 is 1, -1</p> </li> </ul> </div> <p> </p> <p> This assumes a loudspeaker set up as a1 is left front, a2 is right front, a3 is left back, a4 is right back. Values greater than 1 will result in sounds being attenuated, as if in the distance. <span class="emphasis"><em>space</em></span> considers the speakers to be at a distance of 1; smaller values of xy can be used, but <span class="emphasis"><em>space</em></span> will not amplify the signal in this case. It will, however balance the signal so that it can sound as if it were within the 4 speaker <span class="emphasis"><em>space</em></span>. x=0, y=1, will place the signal equally balanced between left and right front channels, x=y=0 will place the signal equally in all 4 channels, and so on. Although there must be 4 output signals from <span class="emphasis"><em>space</em></span>, it can be used in a 2 channel orchestra. If the xy's are kept so that Y>=1, it should work well to do panning and fixed localization in a stereo field. </p> </div> <div class="refsect1" title="Examples"> <a id="id3233776"></a> <h2>Examples</h2> <p> </p> <div class="informalexample"> <pre class="programlisting"> <span class="oblock">instr</span> 1 asig <span class="comment">;some audio signal</span> ktime <span class="opc">line</span> 0, p3, p10 a1, a2, a3, a4 <span class="opc">space</span> asig,1, ktime, .1 ar1, ar2, ar3, ar4 <span class="opc">spsend</span> ga1 <span class="op">=</span> ga1<span class="op">+</span>ar1 ga2 <span class="op">=</span> ga2<span class="op">+</span>ar2 ga3 <span class="op">=</span> ga3<span class="op">+</span>ar3 ga4 <span class="op">=</span> ga4<span class="op">+</span>ar4 <span class="op">outq</span> a1, a2, a3, a4 <span class="oblock">endin</span> <span class="oblock">instr</span> 99 <span class="comment">; reverb instrument</span> a1 <span class="opc">reverb2</span> ga1, 2.5, .5 a2 <span class="opc">reverb2</span> ga2, 2.5, .5 a3 <span class="opc">reverb2</span> ga3, 2.5, .5 a4 <span class="opc">reverb2</span> ga4, 2.5, .5 <span class="emphasis"><em>outq</em></span> a1, a2, a3, a4 ga1 <span class="op">=</span>0 ga2 <span class="op">=</span>0 ga3 <span class="op">=</span>0 ga4 <span class="op">=</span>0 <span class="oblock">endin</span></pre> </div> <p> </p> <p> In the above example, the signal, <span class="emphasis"><em>asig</em></span>, is moved according to the data in Function #1 indexed by <span class="emphasis"><em>ktime</em></span>. <span class="emphasis"><em>space</em></span> sends the appropriate amount of the signal internally to <span class="emphasis"><em>spsend</em></span>. The outputs of the <span class="emphasis"><em>spsend</em></span> 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. </p> <p> <span class="emphasis"><em>space</em></span> 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. </p> <div class="informalexample"> <pre class="programlisting"> <span class="oblock">instr</span> 1 ... a1, a2, a3, a4 <span class="opc">space</span> asig, 0, 0, .1, p4, p5 ar1, ar2, ar3, ar4 <span class="opc">spsend </span> ga1 <span class="op">=</span> ga1<span class="op">+</span>ar1 ga2 <span class="op">=</span> ga2<span class="op">+</span>ar2 <span class="opc">outs</span> a1, a2 <span class="oblock">endin</span> <span class="oblock">instr</span> 99 <span class="comment">; reverb....</span> .... <span class="oblock">endin</span></pre> </div> <p> </p> <p> A few notes: p4 and p5 are the x and y values </p> <div class="informalexample"> <pre class="programlisting"> <span class="comment">;place the sound in the left speaker and near</span> <span class="stamnt">i</span>1 0 1 -1 1 <span class="comment">;place the sound in the right speaker and far</span> <span class="stamnt">i</span>1 1 1 45 45 <span class="comment">;place the sound equally between left and right and in the middle ground distance</span> <span class="stamnt">i</span>1 2 1 0 12 <span class="stamnt">e</span></pre> </div> <p> </p> <p> The next example shows a simple intuitive use of the distance values returned by <span class="emphasis"><em>spdist</em></span> to simulate Doppler shift. </p> <div class="informalexample"> <pre class="programlisting"> ktime <span class="opc">line</span> 0, p3, 10 kdist <span class="opc">spdist</span> 1, ktime kfreq <span class="op">=</span> (ifreq <span class="op">*</span> 340) <span class="op">/</span> (340 <span class="op">+</span> kdist) asig <span class="opc">oscili</span> iamp, kfreq, 1 a1, a2, a3, a4 <span class="opc">space</span> asig, 1, ktime, .1 ar1, ar2, ar3, ar4 <span class="opc">spsend</span></pre> </div> <p> </p> <p> The same function and time values are used for both <span class="emphasis"><em>spdist</em></span> and <span class="emphasis"><em>space</em></span>. This insures that the distance values used internally in the <span class="emphasis"><em>space</em></span> unit will be the same as those returned by <span class="emphasis"><em>spdist</em></span> to give the impression of a Doppler shift! </p> </div> <div class="refsect1" title="See Also"> <a id="id3234208"></a> <h2>See Also</h2> <p> <a class="link" href="space.html" title="space"><em class="citetitle">space</em></a>, <a class="link" href="spdist.html" title="spdist"><em class="citetitle">spdist</em></a> </p> </div> <div class="refsect1" title="Credits"> <a id="id3234234"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Richard Karpen</td> </tr> <tr> <td>Seattle, WA USA</td> </tr> <tr> <td>1998</td> </tr> </table> <p> </p> <p>New in Csound version 3.48</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="splitrig.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="sprintf.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">splitrig </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> sprintf</td> </tr> </table> </div> </body> </html>