| 1 | |
| 2 | <refentry id="urd"> |
| 3 | <indexterm id="IndexUrd"><primary>urd</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Random (Noise) Generators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>urd</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>urd</refname> |
| 13 | <refpurpose> |
| 14 | A discrete user-defined-distribution random generator that can be used as a function. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | A discrete user-defined-distribution random generator that can be used as a function. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>aout = <command>urd</command>(ktableNum)</synopsis> |
| 28 | |
| 29 | <synopsis>iout = <command>urd</command>(itableNum)</synopsis> |
| 30 | |
| 31 | <synopsis>kout = <command>urd</command>(ktableNum)</synopsis> |
| 32 | </refsect1> |
| 33 | |
| 34 | <refsect1> |
| 35 | <title>Initialization</title> |
| 36 | <para> |
| 37 | <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 |
| 38 | </para> |
| 39 | </refsect1> |
| 40 | |
| 41 | <refsect1> |
| 42 | <title>Performance</title> |
| 43 | <para> |
| 44 | <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 |
| 45 | </para> |
| 46 | |
| 47 | <para> |
| 48 | <emphasis>urd</emphasis> is the same opcode as <link linkend="duserrnd"><citetitle>duserrnd</citetitle></link>, but can be used in function fashion. |
| 49 | </para> |
| 50 | |
| 51 | <para> |
| 52 | For a tutorial about random distribution histograms and functions see: |
| 53 | |
| 54 | <itemizedlist> |
| 55 | <listitem> |
| 56 | <para> |
| 57 | D. Lorrain. "A panoply of stochastic cannons". In C. Roads, ed. 1989. Music machine. Cambridge, Massachusetts: MIT press, pp. 351 - 379. |
| 58 | </para> |
| 59 | </listitem> |
| 60 | </itemizedlist> |
| 61 | </para> |
| 62 | </refsect1> |
| 63 | |
| 64 | <refsect1> |
| 65 | <title>Examples</title> |
| 66 | <para> |
| 67 | Here is an example of the urd opcode. It uses the file <ulink url="examples/urd.csd"><citetitle>urd.csd</citetitle></ulink>. |
| 68 | <example> |
| 69 | <title>Example of the urd opcode.</title> |
| 70 | <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> |
| 71 | <xi:include href="examples-xml/urd.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 72 | </example> |
| 73 | Its output should include lines like these: |
| 74 | <screen> |
| 75 | i1 184.61538 |
| 76 | i1 130.76923 |
| 77 | i1 169.23077 |
| 78 | i1 12.00000 |
| 79 | ....... |
| 80 | |
| 81 | WARNING: Seeding from current time 3751086165 |
| 82 | |
| 83 | i2 138.46154 |
| 84 | i2 12.00000 |
| 85 | i2 123.07692 |
| 86 | i2 161.53846 |
| 87 | i2 123.07692 |
| 88 | i2 153.84615 |
| 89 | ...... |
| 90 | </screen> |
| 91 | </para> |
| 92 | </refsect1> |
| 93 | |
| 94 | <refsect1> |
| 95 | <title>See also</title> |
| 96 | <para><link linkend="SiggenNoise"><citetitle>Random (Noise) Generators</citetitle></link> |
| 97 | </para> |
| 98 | </refsect1> |
| 99 | |
| 100 | <refsect1> |
| 101 | <title>Credits</title> |
| 102 | <para>Author: &namegabriel;</para> |
| 103 | <para>New in Version 4.16</para> |
| 104 | </refsect1> |
| 105 | </refentry> |