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

    <refpurpose>
      Returns a random number in a unipolar range.
      <indexterm id="IndexRnd"><primary>rnd</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns a random number in a unipolar range.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>rnd</command>(x) (init- or control-rate only)</synopsis>

    <para>
      Where the argument within the parentheses may be an expression. These value converters sample a global random sequence, but do not reference <emphasis>seed</emphasis>. The result can be a term in a further expression.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      Returns a random number in the unipolar range 0 to <emphasis>x</emphasis>.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the rnd opcode. It uses the files <ulink url="examples/rnd.orc"><citetitle>rnd.orc</citetitle></ulink> and <ulink url="examples/rnd.sco"><citetitle>rnd.sco</citetitle></ulink>.

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

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

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

      Its output should include lines like this:
      <screen>
instr 1:  i1 = 0.974
instr 1:  i1 = 0.139
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="birnd"><citetitle>birnd</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namebarry;</member>
        <member>MIT</member>
        <member>Cambridge, Massachussetts</member>
        <member>1997</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
