<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="urd">
  <refmeta>
    <refentrytitle>urd</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>urd</refname>
    <refpurpose>
      A discrete user-defined-distribution random generator that can be used as a function.
      <indexterm id="IndexUrd"><primary>urd</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      A discrete user-defined-distribution random generator that can be used as a function.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>aout = <command>urd</command>(ktableNum)</synopsis>

    <synopsis>iout = <command>urd</command>(itableNum)</synopsis>

    <synopsis>kout = <command>urd</command>(ktableNum)</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>itableNum</emphasis> -- number of table containing the random-distribution function.  Such table is generated by the user. See <link linkend="GEN40">GEN40</link>, <link linkend="GEN41">GEN41</link>, and <link linkend="GEN42">GEN42</link>. The table length does not need to be a power of 2
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ktableNum</emphasis> -- number of table containing the random-distribution function.  Such table is generated by the user. See <link linkend="GEN40">GEN40</link>, <link linkend="GEN41">GEN41</link>, and <link linkend="GEN42">GEN42</link>. The table length does not need to be a power of 2
    </para>

    <para>
      <emphasis>urd</emphasis> is the same opcode as <link linkend="duserrnd"><citetitle>duserrnd</citetitle></link>, but can be used in function fashion. 
    </para>

    <para>
      For a tutorial about random distribution histograms and functions see:

      <itemizedlist>
        <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>
      </itemizedlist>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="cuserrnd"><citetitle>cuserrnd</citetitle></link>,
      <link linkend="duserrnd"><citetitle>duserrnd</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Author: &namegabriel;</para>
    <para>New in Version 4.16</para>
  </refsect1>
</refentry>
