Sophie

Sophie

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

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>foscili</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="foscil.html" title="foscil" />
    <link rel="next" href="fout.html" title="fout" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">foscili</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="foscil.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="fout.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="foscili">
      <a id="foscili"></a>
      <div class="titlepage"></div>
      <a id="Indexfoscili" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">foscili</span>
        </h2>
        <p>foscili — 
      Basic frequency modulated oscillator with linear interpolation.
          </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="id2914656"></a>
        <h2>Description</h2>
        <p>
      Basic frequency modulated oscillator with linear interpolation.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="id2914668"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">ares <span class="command"><strong>foscili</strong></span> xamp, kcps, xcar, xmod, kndx, ifn [, iphs]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="id2915602"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifn</em></span> -- function table number. Requires a wrap-around guard point.
    </p>
        <p>
      <span class="emphasis"><em>iphs</em></span> (optional, default=0) -- initial phase of waveform in table <span class="emphasis"><em>ifn</em></span>, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped. The default value is 0.
    </p>
      </div>
      <div class="refsect1" title="Performance">
        <a id="id2915634"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>xamp</em></span> -- the amplitude of the output signal.
    </p>
        <p>
      <span class="emphasis"><em>kcps</em></span> -- a common denominator, in cycles per second, for the carrier and modulating frequencies.
    </p>
        <p>
      <span class="emphasis"><em>xcar</em></span> -- a factor that, when multiplied by the <span class="emphasis"><em>kcps</em></span> parameter, gives the carrier frequency.
    </p>
        <p>
      <span class="emphasis"><em>xmod</em></span> -- a factor that, when multiplied by the <span class="emphasis"><em>kcps</em></span> parameter, gives the modulating frequency.
    </p>
        <p>
      <span class="emphasis"><em>kndx</em></span> -- the modulation index.
    </p>
        <p>
      <span class="emphasis"><em>foscili</em></span> differs from <a class="link" href="foscil.html" title="foscil"><em class="citetitle">foscil</em></a> in that the standard procedure of using a truncated phase as a sampling index is here replaced by a process that interpolates between two successive lookups. Interpolating generators will produce a noticeably cleaner output signal, but they may take as much as twice as long to run. Adequate accuracy can also be gained without the time cost of interpolation by using large stored function tables of 2K, 4K or 8K points if the space is available.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="id2915724"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the foscili opcode. It uses the file <a class="ulink" href="examples/foscili.csd" target="_top"><em class="citetitle">foscili.csd</em></a>.

      </p>
        <div class="example">
          <a id="id2915740"></a>
          <p class="title">
            <b>Example 261. Example of the foscili opcode.</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    No messages</span>
-odac           -iadc     -d     <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 foscili.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 - a basic FM waveform.</span>
<span class="oblock">instr</span> 1
  kamp <span class="op">=</span> 10000
  kcps <span class="op">=</span> 440
  kcar <span class="op">=</span> 600
  kmod <span class="op">=</span> 210
  kndx <span class="op">=</span> 2
  ifn <span class="op">=</span> 1

  a1 <span class="opc">foscil</span> kamp, kcps, kcar, kmod, kndx, ifn
  <span class="opc">out</span> a1
<span class="oblock">endin</span>

<span class="comment">; Instrument #2 - the basic FM waveform with extra interpolation.</span>
<span class="oblock">instr</span> 2
  kamp <span class="op">=</span> 10000
  kcps <span class="op">=</span> 440
  kcar <span class="op">=</span> 600
  kmod <span class="op">=</span> 210
  kndx <span class="op">=</span> 2
  ifn <span class="op">=</span> 1

  a1 <span class="opc">foscili</span> kamp, kcps, kcar, kmod, kndx, ifn
  <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 table with a small amount of data.</span>
<span class="stamnt">f</span> 1 0 4096 10 1

<span class="comment">; Play Instrument #1, the basic FM instrument, for </span>
<span class="comment">; two seconds. This should sound relatively rough.</span>
<span class="stamnt">i</span> 1 0 2

<span class="comment">; Play Instrument #2, the interpolated FM instrument, for</span>
<span class="comment">; two seconds. This should sound relatively smooth.</span>
<span class="stamnt">i</span> 2 2 2
<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="Credits">
        <a id="id2915778"></a>
        <h2>Credits</h2>
        <p>Example written by Kevin Conder.</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="foscil.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="fout.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">foscil </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> fout</td>
        </tr>
      </table>
    </div>
  </body>
</html>