| 1 | |
| 2 | <refentry id="urandom"> |
| 3 | <indexterm id="IndexUrandom"><primary>urandom</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Random (Noise) Generators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>urandom</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>urandom</refname> |
| 13 | <refpurpose> |
| 14 | truly random opcodes with controllable range. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para>Plugin opcode in urandom.</para> |
| 21 | <para> |
| 22 | Truly random opcodes with controllable range. These |
| 23 | units are for Unix-like systems only and use /dev/urandom to construct |
| 24 | Csound random values |
| 25 | </para> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Syntax</title> |
| 30 | <synopsis>ax <command>urandom</command> [imin, imax]</synopsis> |
| 31 | |
| 32 | <synopsis>ix <command>urandom</command> [imin, imax]</synopsis> |
| 33 | |
| 34 | <synopsis>kx <command>urandom</command> [imin, imax]</synopsis> |
| 35 | </refsect1> |
| 36 | |
| 37 | <refsect1> |
| 38 | <title>Initialization</title> |
| 39 | <para> |
| 40 | <emphasis>ix</emphasis> -- i-rate output value. |
| 41 | </para> |
| 42 | |
| 43 | <para> |
| 44 | <emphasis>imin</emphasis> -- minimum value of range; defaults to -1. |
| 45 | </para> |
| 46 | |
| 47 | <para> |
| 48 | <emphasis>imax</emphasis> -- maximum value of range; defaults to +1. |
| 49 | </para> |
| 50 | |
| 51 | <note> |
| 52 | <title>Notes</title> |
| 53 | <para> |
| 54 | The algorithm produces 2^64 different possible values which |
| 55 | are scaled to fit the range requested. The randomness comes |
| 56 | form the usual Linux/OSX /dev/urandom method, and there is no |
| 57 | guarantee that it will be truly random, but there is a good |
| 58 | chance. It does not show any cycles. |
| 59 | </para> |
| 60 | </note> |
| 61 | </refsect1> |
| 62 | |
| 63 | <refsect1> |
| 64 | <title>Performance</title> |
| 65 | <para> |
| 66 | <emphasis>ax</emphasis> -- a-rate output value. |
| 67 | </para> |
| 68 | |
| 69 | <para> |
| 70 | <emphasis>kx</emphasis> -- k-rate output value. |
| 71 | </para> |
| 72 | </refsect1> |
| 73 | |
| 74 | <refsect1> |
| 75 | <title>Examples</title> |
| 76 | <para> |
| 77 | Here is an example of the urandom opcode at a-rate. It uses the file <ulink url="examples/urandom.csd"><citetitle>urandom.csd</citetitle></ulink>. |
| 78 | |
| 79 | <example> |
| 80 | <title>An example of the urandom opcode at a-rate.</title> |
| 81 | |
| 82 | |
| 83 | |
| 84 | <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> |
| 85 | <xi:include href="examples-xml/urandom.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 86 | </example> |
| 87 | </para> |
| 88 | <para> |
| 89 | Here is an example of the urandom opcode at k-rate. It uses the file <ulink url="examples/urandom_krate.csd"><citetitle>urandom_krate.csd</citetitle></ulink>. |
| 90 | |
| 91 | <example> |
| 92 | <title>An example of the urandom opcode at k-rate.</title> |
| 93 | |
| 94 | <xi:include href="examples-xml/urandom_krate.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 95 | </example> |
| 96 | |
| 97 | Its output should include lines like this: |
| 98 | <screen> |
| 99 | k1=0.229850 |
| 100 | k1=-0.077047 |
| 101 | k1=-0.199339 |
| 102 | k1=-0.620577 |
| 103 | k1=-0.119447 |
| 104 | k1=-0.596258 |
| 105 | k1=0.525800 |
| 106 | k1=-0.171583 |
| 107 | k1=-0.017196 |
| 108 | k1=-0.974613 |
| 109 | k1=-0.036276 |
| 110 | </screen> |
| 111 | </para> |
| 112 | |
| 113 | </refsect1> |
| 114 | |
| 115 | <refsect1> |
| 116 | <title>See also</title> |
| 117 | <para><link linkend="SiggenNoise"><citetitle>Random (Noise) Generators</citetitle></link> |
| 118 | </para> |
| 119 | </refsect1> |
| 120 | |
| 121 | <refsect1> |
| 122 | <title>Credits</title> |
| 123 | <para>Author: &namejohn;</para> |
| 124 | <para>New in version 5.13</para> |
| 125 | </refsect1> |
| 126 | </refentry> |