summaryrefslogtreecommitdiff
path: root/opcodes/birnd.xml
blob: 189c624552d13b20da49bd3819d34da748245d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<refentry id="birnd">
<indexterm id="IndexBirnd"><primary>birnd</primary></indexterm>
  <refentryinfo><title>Mathematical Operations:Random Functions</title></refentryinfo>
  <refmeta>
    <refentrytitle>birnd</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>birnd</refname>

    <refpurpose>
      Returns a random number in a bi-polar range.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns a random number in a bi-polar range.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>birnd</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 bipolar range -<emphasis>x</emphasis> to <emphasis>x</emphasis>. <emphasis>rnd</emphasis> and <emphasis>birnd</emphasis> obtain values from a global pseudo-random number generator, then scale them into the requested range. The single global generator will thus distribute its sequence to these units throughout the performance, in whatever order the requests arrive.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the birnd opcode. It uses the file <ulink url="examples/birnd.csd"><citetitle>birnd.csd</citetitle></ulink>.

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

        

        <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
          <xi:include href="examples-xml/birnd.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>

      Its output should include lines like:
      <screen>
instr 1:  i1 = 0.947
instr 1:  i1 = -0.721</screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="rnd"><citetitle>rnd</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>Extended in 3.47 to x-rate by &namejohn;.</para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>