Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > b707d9a4ee443103660a75ccb6e51334 > files > 136

csound-doc-5.19.01-10.mga5.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>GEN16</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" />
    <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="GEN15.html" title="GEN15" />
    <link rel="next" href="GEN17.html" title="GEN17" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">GEN16</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="GEN15.html">Prev</a> </td>
          <th width="60%" align="center">Score Statements and GEN Routines</th>
          <td width="20%" align="right"> <a accesskey="n" href="GEN17.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="GEN16">
      <a id="GEN16"></a>
      <div class="titlepage"></div>
      <a id="IndexGEN16" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">GEN16</span>
        </h2>
        <p>GEN16 — 
      Creates a table from a starting value to an ending value.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="idp77717464"></a>
        <h2>Description</h2>
        <p>
      Creates a table from <span class="emphasis"><em>beg</em></span> value to <span class="emphasis"><em>end</em></span> value of <span class="emphasis"><em>dur</em></span> steps.
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="idp77718752"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>f</strong></span> # time size 16 val1 dur1 type1 val2 [dur2 type2 val3 ... typeX valN]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="idp77777384"></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 a 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>). The
      normal value is power-of-2 plus 1.
    </p>
        <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
      The end value is only reached  when the table length is power-of-2 plus 1.
      (This length is crucial for use with the tab opcode.)
    </td>
            </tr>
          </table>
        </div>
        <p>
      <span class="emphasis"><em>beg</em></span> -- starting value
    </p>
        <p>
      <span class="emphasis"><em>dur</em></span> -- number of segments
    </p>
        <p>
      <span class="emphasis"><em>type</em></span> -- if 0, a straight line is produced. If non-zero, then <span class="emphasis"><em>GEN16</em></span> creates the following curve, for <span class="emphasis"><em>dur</em></span> steps:
      </p>
        <div class="literallayout">
          <p><br />
beg + (end - beg) * (1 - exp( i*type/(dur-1) )) / (1 - exp(type))<br />
      </p>
        </div>
        <p>
    </p>
        <p>
      <span class="emphasis"><em>end</em></span> -- value after <span class="emphasis"><em>dur</em></span> segments
    </p>
        <p>
      Here are some examples of the curves generated for different values of <span class="emphasis"><em>type</em></span>:
      </p>
        <div class="mediaobject">
          <img src="images/gen16_types.png" alt="Tables generated by GEN16 for different values of type." />
          <div class="caption">
            <p>Tables generated by GEN16 for different values of type.</p>
          </div>
        </div>
        <p>
    </p>
        <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note: Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
        If <span class="emphasis"><em>type</em></span> &gt; 0, there is a slowly rising (concave) or slowly decaying
        (convex) curve, while if <span class="emphasis"><em>itype</em></span> &lt; 0, the curve is fast rising (convex) or
        fast decaying (concave). See also <a class="link" href="transeg.html" title="transeg"><em class="citetitle">transeg</em></a>.
      </p>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp77786160"></a>
        <div class="example">
          <a id="idp77786288"></a>
          <p class="title">
            <strong>Example 1052. A simple example of the GEN16 routine.</strong>
          </p>
          <div class="example-contents">
            <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 gen16.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 128
<span class="ohdr">nchnls</span> <span class="op">=</span> 1

<span class="oblock">instr</span> 1
  kcps <span class="opc">init</span> 1<span class="op">/</span>p3
  kndx <span class="opc">phasor</span> kcps

  ifn <span class="op">=</span> p4
  ixmode <span class="op">=</span> 1
  kval <span class="opc">table</span> kndx, ifn, ixmode

  ibasefreq <span class="op">=</span> 440
  kfreq <span class="op">=</span> kval <span class="op">*</span> ibasefreq
  a1 <span class="opc">oscil</span> 20000, ibasefreq <span class="op">+</span> kfreq, 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="stamnt">f</span> 1 0 16384 10 1

<span class="stamnt">f</span> 2 0 1024 16 1 1024 1 0
<span class="stamnt">f</span> 3 0 1024 16 1 1024 2 0
<span class="stamnt">f</span> 4 0 1024 16 1 1024 10 0
<span class="stamnt">f</span> 5 0 1024 16 1 1024 -1 0
<span class="stamnt">f</span> 6 0 1024 16 1 1024 -2 0
<span class="stamnt">f</span> 7 0 1024 16 1 1024 -10 0

<span class="stamnt">i</span> 1 0 2 2
<span class="stamnt">i</span> 1 + . 3
<span class="stamnt">i</span> 1 + . 4
<span class="stamnt">i</span> 1 + . 5
<span class="stamnt">i</span> 1 + . 6
<span class="stamnt">i</span> 1 + . 7

<span class="stamnt">e</span>


<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <br class="example-break" />
      </div>
      <div class="refsect1" title="Credits">
        <a id="idp77787240"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: John ffitch</td>
          </tr>
          <tr>
            <td>University of Bath, Codemist. Ltd.</td>
          </tr>
          <tr>
            <td>Bath, UK</td>
          </tr>
          <tr>
            <td>October, 2000</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in Csound version 4.09</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="GEN15.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="GEN17.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">GEN15 </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> GEN17</td>
        </tr>
      </table>
    </div>
  </body>
</html>