Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 6ed14ebfd686aa32f7956e552aa2e21d > files > 2328

csound-manual-5.13.0-5.fc15.noarch.rpm

<?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>pan</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="p5gdata.html" title="p5gdata" />
    <link rel="next" href="pan2.html" title="pan2" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">pan</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="p5gdata.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="pan2.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="pan">
      <a id="pan"></a>
      <div class="titlepage"></div>
      <a id="IndexPan" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">pan</span>
        </h2>
        <p>pan — 
      Distribute an audio signal amongst four channels.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="id3083530"></a>
        <h2>Description</h2>
        <p>
      Distribute an audio signal amongst four channels with localization control.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="id3083542"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">a1, a2, a3, a4 <span class="command"><strong>pan</strong></span> asig, kx, ky, ifn [, imode] [, ioffset]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="id3083753"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifn</em></span> -- function table number of a stored pattern describing the amplitude growth in a speaker channel as sound moves towards it from an adjacent speaker. Requires extended guard-point.
    </p>
        <p>
      <span class="emphasis"><em>imode</em></span> (optional) -- mode of the <span class="emphasis"><em>kx, ky</em></span> position values. 0 signifies raw index mode, 1 means the inputs are normalized (0 - 1). The default value is 0.
    </p>
        <p>
      <span class="emphasis"><em>ioffset</em></span> (optional) -- offset indicator for <span class="emphasis"><em>kx, ky</em></span>. 0 infers the origin to be at channel 3 (left rear); 1 requests an axis shift to the quadraphonic center. The default value is 0.
    </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="id3083795"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>pan</em></span> takes an input signal <span class="emphasis"><em>asig</em></span> and distributes it amongst four outputs (essentially quad speakers) according to the controls <span class="emphasis"><em>kx</em></span> and <span class="emphasis"><em>ky</em></span>. For normalized input (mode=1) and no offset, the four output locations are in order: left-front at (0,1), right-front at (1,1), left-rear at the origin (0,0), and right-rear at (1,0). In the notation (<span class="emphasis"><em>kx</em></span>, <span class="emphasis"><em>ky)</em></span>, the coordinates <span class="emphasis"><em>kx</em></span> and <span class="emphasis"><em>ky</em></span>, each ranging 0 - 1, thus control the 'rightness' and 'forwardness' of a sound location.
    </p>
        <p>
      Movement between speakers is by amplitude variation, controlled by the stored function table <span class="emphasis"><em>ifn</em></span>. As <span class="emphasis"><em>kx</em></span> goes from 0 to 1, the strength of the right-hand signals will grow from the left-most table value to the right-most, while that of the left-hand signals will progress from the right-most table value to the left-most. For a simple linear pan, the table might contain the linear function 0 - 1. A more correct pan that maintains constant power would be obtained by storing the first quadrant of a sinusoid. Since <span class="emphasis"><em>pan</em></span> will scale and truncate <span class="emphasis"><em>kx</em></span> and <span class="emphasis"><em>ky</em></span> in simple table lookup, a medium-large table (say 8193) should be used.
    </p>
        <p>
      <span class="emphasis"><em>kx, ky</em></span> values are not restricted to 0 - 1. A circular motion passing through all four speakers (inscribed) would have a diameter of root 2, and might be defined by a circle of radius R = root 1/2 with center at (.5,.5). <span class="emphasis"><em>kx, ky</em></span> would then come from Rcos(angle), Rsin(angle), with an implicit origin at (.5,.5) (i.e. <span class="emphasis"><em>ioffset</em></span> = 1). Unscaled raw values operate similarly. Sounds can thus be located anywhere in the polar or Cartesian plane; points lying outside the speaker square are projected correctly onto the square's perimeter as for a listener at the center.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="id3084489"></a>
        <h2>Examples</h2>
        <p>
      </p>
        <div class="informalexample">
          <pre class="programlisting">
<span class="oblock">instr</span>     1
  k1           <span class="opc">phasor</span>    1<span class="op">/</span>p3                     <span class="comment">; fraction of circle</span>
  k2           <span class="opc">tablei</span>    k1, 1, 1                 <span class="comment">; sin of angle (sinusoid in f1)</span>
  k3           <span class="opc">tablei</span>    k1, 1, 1, .25, 1         <span class="comment">; cos of angle (sin offset 1/4 circle)</span>
  a1           <span class="opc">oscili</span>    10000,440, 1             <span class="comment">; audio signal..</span>
  a1,a2,a3,a4  <span class="opc">pan</span>       a1, k2<span class="op">/</span>2, k3<span class="op">/</span>2, 2, 1, 1  <span class="comment">; sent in a circle (f2=1st quad sin)</span>
                                 
               <span class="opc">outq</span> a1, a2, a3, a4
<span class="oblock">endin</span></pre>
        </div>
        <p>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="p5gdata.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="pan2.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">p5gdata </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> pan2</td>
        </tr>
      </table>
    </div>
  </body>
</html>