Sophie

Sophie

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

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>GEN21</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="GEN20.html" title="GEN20" />
    <link rel="next" href="GEN22.html" title="GEN22" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">GEN21</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="GEN20.html">Prev</a> </td>
          <th width="60%" align="center">Score Statements and GEN Routines</th>
          <td width="20%" align="right"> <a accesskey="n" href="GEN22.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry" title="GEN21">
      <a id="GEN21"></a>
      <div class="titlepage"></div>
      <a id="IndexGEN21" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">GEN21</span>
        </h2>
        <p>GEN21 — 
      Generates tables of different random distributions.
    </p>
      </div>
      <div class="refsect1" title="Description">
        <a id="id3739901"></a>
        <h2>Description</h2>
        <p>
      This generates tables of different random distributions. (See also <a class="link" href="betarand.html" title="betarand"><em class="citetitle">betarand</em></a>, <a class="link" href="bexprnd.html" title="bexprnd"><em class="citetitle">bexprnd</em></a>, <a class="link" href="cauchy.html" title="cauchy"><em class="citetitle">cauchy</em></a>, <a class="link" href="exprand.html" title="exprand"><em class="citetitle">exprand</em></a>, <a class="link" href="gauss.html" title="gauss"><em class="citetitle">gauss</em></a>, <a class="link" href="linrand.html" title="linrand"><em class="citetitle">linrand</em></a>, <a class="link" href="pcauchy.html" title="pcauchy"><em class="citetitle">pcauchy</em></a>, <a class="link" href="poisson.html" title="poisson"><em class="citetitle">poisson</em></a>, <a class="link" href="trirand.html" title="trirand"><em class="citetitle">trirand</em></a>, <a class="link" href="unirand.html" title="unirand"><em class="citetitle">unirand</em></a>, and <a class="link" href="weibull.html" title="weibull"><em class="citetitle">weibull</em></a>)
    </p>
      </div>
      <div class="refsect1" title="Syntax">
        <a id="id3740871"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>f</strong></span> # time size 21 type level [arg1  [arg2]]</pre>
      </div>
      <div class="refsect1" title="Initialization">
        <a id="id3740888"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>time</em></span> and <span class="emphasis"><em>size</em></span> are the usual GEN function arguments. <span class="emphasis"><em>level</em></span> defines the amplitude. Note that GEN21 is not self-normalizing as are most other GEN functions. <span class="emphasis"><em>type</em></span> defines the distribution to be used as follow:

      </p>
        <div class="itemizedlist">
          <ul class="itemizedlist" type="disc">
            <li class="listitem">
              <p>1 = Uniform (positive numbers only)</p>
            </li>
            <li class="listitem">
              <p>2 = Linear (positive numbers only)</p>
            </li>
            <li class="listitem">
              <p>3 = Triangular (positive and negative numbers)</p>
            </li>
            <li class="listitem">
              <p>4 = Exponential (positive numbers only)</p>
            </li>
            <li class="listitem">
              <p>5 = Biexponential (positive and negative numbers)</p>
            </li>
            <li class="listitem">
              <p>6 = Gaussian (positive and negative numbers)</p>
            </li>
            <li class="listitem">
              <p>7 = Cauchy (positive and negative numbers)</p>
            </li>
            <li class="listitem">
              <p>8 = Positive Cauchy (positive numbers only)</p>
            </li>
            <li class="listitem">
              <p>9 = Beta (positive numbers only)</p>
            </li>
            <li class="listitem">
              <p>10 = Weibull (positive numbers only)</p>
            </li>
            <li class="listitem">
              <p>11 = Poisson (positive numbers only)</p>
            </li>
          </ul>
        </div>
        <p>

      Of all these cases only 9 (Beta) and 10 (Weibull) need extra arguments. Beta needs two arguments and Weibull one.
    </p>
        <p>
      If <span class="emphasis"><em>type</em></span> = 6, the random numbers in the ftable follow a normal distribution centered
      around 0.0 (mu = 0.0) with a variance (sigma) of <span class="emphasis"><em>level</em></span> / 3.83. Thus more than 99.99%
      of the random values generated are in the range -<span class="emphasis"><em>level</em></span> to +<span class="emphasis"><em>level</em></span>.
      The default value for <span class="emphasis"><em>level</em></span> is 1 (sigma = 0.261).
      If a mean value different of 0.0 is desired, this mean value has to be added to the generated numbers.
    </p>
      </div>
      <div class="refsect1" title="Examples">
        <a id="id3741029"></a>
        <h2>Examples</h2>
        <p>
      </p>
        <div class="informalexample">
          <pre class="programlisting">
<span class="stamnt">f</span>1 0 1024 21 1       <span class="comment">; Uniform (white noise)</span>
<span class="stamnt">f</span>1 0 1024 21 6       <span class="comment">; Gaussian (mu=0.0, sigma=1/3.83=0.261)</span>
<span class="stamnt">f</span>1 0 1024 21 6 5.745 <span class="comment">; Gaussian (mu=0.0, sigma=5.745/3.83=1.5)</span>
<span class="stamnt">f</span>1 0 1024 21 9 1 1 2 <span class="comment">; Beta (note that level precedes arguments)</span>
<span class="stamnt">f</span>1 0 1024 21 10 1 2  <span class="comment">; Weibull</span></pre>
        </div>
        <p>

      All of the above additions were designed by the author between May and December 1994, under the supervision of Dr. Richard Boulanger.
    </p>
      </div>
      <div class="refsect1" title="Credits">
        <a id="id3741109"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Paris Smaragdis</td>
          </tr>
          <tr>
            <td>MIT, Cambridge</td>
          </tr>
          <tr>
            <td>1995</td>
          </tr>
        </table>
        <p>
    </p>
        <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>
        </table>
        <p>
    </p>
        <p>Precisions about mu and sigma added by François Pinot after a discussion with
    Joachim Heintz on the Csound List, December 2010.</p>
        <p>New in Csound version 3.2</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="GEN20.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="GEN22.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">GEN20 </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> GEN22</td>
        </tr>
      </table>
    </div>
  </body>
</html>