<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="GEN21">
  <refmeta>
    <refentrytitle>GEN21</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>GEN21</refname>
    <refpurpose>
      Generates tables of different random distributions.
      <indexterm id="IndexGEN21"><primary>GEN21</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      This generates tables of different random distributions. (See also <link linkend="betarand"><citetitle>betarand</citetitle></link>, <link linkend="bexprnd"><citetitle>bexprnd</citetitle></link>, <link linkend="cauchy"><citetitle>cauchy</citetitle></link>, <link linkend="exprand"><citetitle>exprand</citetitle></link>, <link linkend="gauss"><citetitle>gauss</citetitle></link>, <link linkend="linrand"><citetitle>linrand</citetitle></link>, <link linkend="pcauchy"><citetitle>pcauchy</citetitle></link>, <link linkend="poisson"><citetitle>poisson</citetitle></link>, <link linkend="trirand"><citetitle>trirand</citetitle></link>, <link linkend="unirand"><citetitle>unirand</citetitle></link>, and <link linkend="weibull"><citetitle>weibull</citetitle></link>)
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>f</command> # time size 21 type level [arg1  [arg2]]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>time</emphasis> and <emphasis>size</emphasis> are the usual GEN function arguments. <emphasis>level</emphasis> defines the amplitude. Note that GEN21 is not self-normalizing as are most other GEN functions. <emphasis>type</emphasis> defines the distribution to be used as follow:

      <itemizedlist>
        <listitem>
          <para>1 = Uniform (positive numbers only)</para>
        </listitem>
        <listitem>
          <para>2 = Linear (positive numbers only)</para>
        </listitem>
        <listitem>
          <para>3 = Triangular (positive and negative numbers)</para>
        </listitem>
        <listitem>
          <para>4 = Exponential (positive numbers only)</para>
        </listitem>
        <listitem>
          <para>5 = Biexponential (positive and negative numbers)</para>
        </listitem>
        <listitem>
          <para>6 = Gaussian (positive and negative numbers)</para>
        </listitem>
        <listitem>
          <para>7 = Cauchy (positive and negative numbers)</para>
        </listitem>
        <listitem>
          <para>8 = Positive Cauchy (positive numbers only)</para>
        </listitem>
        <listitem>
          <para>9 = Beta (positive numbers only)</para>
        </listitem>
        <listitem>
          <para>10 = Weibull (positive numbers only)</para>
        </listitem>
        <listitem>
          <para>11 = Poisson (positive numbers only)</para>
        </listitem>
      </itemizedlist>

      Of all these cases only 9 (Beta) and 10 (Weibull) need extra arguments. Beta needs two arguments and Weibull one.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      <informalexample>
        <programlisting>
<emphasis>f</emphasis>1 0 1024 21 1       ; Uniform (white noise)
<emphasis>f</emphasis>1 0 1024 21 6       ; Gaussian
<emphasis>f</emphasis>1 0 1024 21 9 1 1 2 ; Beta (note that level precedes arguments)
<emphasis>f</emphasis>1 0 1024 21 10 1 2  ; Weibull
        </programlisting>
      </informalexample>

      All of the above additions were designed by the author between May and December 1994, under the supervision of Dr. Richard Boulanger.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &nameparis;</member>
        <member>MIT, Cambridge</member>
        <member>1995</member>
      </simplelist>
    </para>

    <para>
      <simplelist>
        <member>Author: &namejohn;</member>
        <member>University of Bath/Codemist Ltd.</member>
        <member>Bath, UK</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.2</para>
  </refsect1>
</refentry>
