<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="betarand">
  <refmeta>
    <refentrytitle>betarand</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>betarand</refname>
    <refpurpose>
      Beta distribution random number generator (positive values only).
      <indexterm id="IndexBetarand"><primary>betarand</primary></indexterm>
      <indexterm id="IndexBetarandXClass"><primary>x-class noise generators</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Beta distribution random number generator (positive values only). This is an x-class noise generator.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>betarand</command> krange, kalpha, kbeta</synopsis>

    <synopsis>ir <command>betarand</command> krange, kalpha, kbeta</synopsis>

    <synopsis>kr <command>betarand</command> krange, kalpha, kbeta</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>krange</emphasis> -- range of the random numbers (0 - <emphasis>krange</emphasis>). 
    </para>

    <para>
      <emphasis>kalpha</emphasis> -- alpha value. If <emphasis>kalpha</emphasis> is smaller than one, smaller values favor values near 0. 
    </para>

    <para>
      <emphasis>kbeta</emphasis> -- beta value. If <emphasis>kbeta</emphasis> is smaller than one, smaller values favor values near <emphasis>krange</emphasis>. 
    </para>

    <para>
      If both <emphasis>kalpha</emphasis> and <emphasis>kbeta</emphasis> equal one we have uniform distribution. If both <emphasis>kalpha</emphasis> and <emphasis>kbeta</emphasis> are greater than one we have a sort of Gaussian distribution. Outputs only positive numbers.
    </para>

    <para>
      For more detailed explanation of these distributions, see:
      <orderedlist>
        <listitem>
          <para>C. Dodge - T.A. Jerse 1985. Computer music. Schirmer books. pp.265 - 286</para>
        </listitem>

        <listitem>
          <para>D. Lorrain. A panoply of stochastic cannons. In C. Roads, ed. 1989. Music machine . Cambridge, Massachusetts: MIT press, pp. 351 - 379.</para>
        </listitem>
      </orderedlist>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the betarand opcode. It uses the files <ulink url="examples/betarand.orc"><citetitle>betarand.orc</citetitle></ulink> and <ulink url="examples/betarand.sco"><citetitle>betarand.sco</citetitle></ulink>.

      <example>
        <title>Example of the betarand opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/betarand.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/betarand.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      Its output should include lines like:
      <screen>
instr 1:  i1 = 24583.412
      </screen>
    </para>
  </refsect1>
 
  <refsect1>
    <title>See Also</title>
    <para>
      <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>,
      <link linkend="weibull"><citetitle>weibull</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &nameparis;</member>
        <member>MIT, Cambridge</member>
        <member>1995</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
