Sophie

Sophie

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

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>GENsone</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="ScoregensTop.html" title="Score Statements and GEN Routines" />
    <link rel="prev" href="GENexp.html" title="GENexp" />
    <link rel="next" href="GENfarey.html" title="GENfarey" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">GENsone</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="GENexp.html">Prev</a> </td>
          <th width="60%" align="center">Score Statements and GEN Routines</th>
          <td width="20%" align="right"> <a accesskey="n" href="GENfarey.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="GENsone">
      <a id="GENsone"></a>
      <div class="titlepage"></div>
      <a id="IndexGENsone" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">GENsone</span>
        </h2>
        <p>"sone" — 
      Generate a table with values of the sone function.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="id3750500"></a>
        <h2>Description</h2>
        <p>
      Creates an ftable with values of the sone function for equal power.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="id3750512"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>f</strong></span> # time size "sone" start end equalpoint rescale</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="id3750434"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>size</em></span> -- number of points in the table. Must
      be a power of 2 or power-of-2 plus 1 (see <a class="link" href="f.html" title="f Statement (or Function Table Statement)"><em class="citetitle">f statement</em></a>).
    </p>
        <p>
      <span class="emphasis"><em>start, end</em></span> -- first and last value to be stored.  The points stored are uniformly spaced between these to the table size.
    </p>
        <p>
      <span class="emphasis"><em>equalpoint</em></span> -- the point on the curve when the input and output values are equal.
    </p>
        <p>
      <span class="emphasis"><em>rescale</em></span> -- if not zero the table is not rescaled
    </p>
        <p>
      The table is filled with the function x*POWER(x/eqlp,
      FL(33.0)/FL(78.0)) for x between the start and end points.  This
      is the Sone loudness curve.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="id3751370"></a>
        <h2>Examples</h2>
        <p>
      Here is a simple example of the <span class="emphasis"><em>GENsone</em></span> routine. It uses the
      file <a class="ulink" href="examples/gensone.csd" target="_top"><em class="citetitle">gensone.csd</em></a>.
      It will generate a simple sone shaped output wave.

      </p>
        <div class="example">
          <a id="id3751390"></a>
          <p class="title">
            <b>Example 752. A simple example of the GENsone routine.</b>
          </p>
          <div class="example-contents">
            <p>
          See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.
        </p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in   </span>
-odac           -iadc         <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o linseg.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="comment">; Initialize the global variables.</span>
<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">kr</span> <span class="op">=</span> 4410
<span class="ohdr">ksmps</span> <span class="op">=</span> 10
<span class="ohdr">nchnls</span> <span class="op">=</span> 1

<span class="comment">; Instrument #1 Simple oscillator with loudness correction.</span>
<span class="oblock">instr</span> 1
  <span class="comment">; p4 = frequency in pitch-class notation.</span>
  kcps <span class="op">=</span> <span class="opc">cpspch</span>(p4)

  <span class="comment">; Create an amplitude envelope.</span>
  kenv <span class="opc">linseg</span> 0, p3<span class="op">*</span>0.25, 1, p3<span class="op">*</span>0.75, 0
  kamp <span class="opc">tablei</span> 16384<span class="op">*</span>kenv, 2

  a1 <span class="opc">oscil</span> 30000<span class="op">*</span>kamp, kcps, 1
  <span class="opc">out</span> a1
<span class="oblock">endin</span>


<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="comment">; Table #1, a sine wave.</span>
<span class="stamnt">f</span> 1 0 16384 10 1
<span class="stamnt">f</span> 2 0 16384 "sone" 1 32000 32000 0

<span class="comment">; Play Instrument #1 for a half-second, p4=8.00</span>
<span class="stamnt">i</span> 1 0 0.5 8.00
<span class="comment">; Play Instrument #1 for a half-second, p4=8.01</span>
<span class="stamnt">i</span> 1 1 0.5 8.01
<span class="comment">; Play Instrument #1 for a half-second, p4=8.02</span>
<span class="stamnt">i</span> 1 2 0.5 8.02
<span class="comment">; Play Instrument #1 for a half-second, p4=8.03</span>
<span class="stamnt">i</span> 1 3 0.5 8.03
<span class="stamnt">e</span>


<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1" title="See Also">
        <a id="id3751429"></a>
        <h2>See Also</h2>
        <p>
       <a class="link" href="GENexp.html" title="GENexp"><em class="citetitle">GENexp</em></a> and
       <a class="link" href="GENtanh.html" title="GENtanh"><em class="citetitle">GENtanh</em></a>.
     </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="id3751454"></a>
        <h2>Credits</h2>
        <p>Written by Victor Lazzarini</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="GENexp.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="ScoregensTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="GENfarey.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">GENexp </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> GENfarey</td>
        </tr>
      </table>
    </div>
  </body>
</html>