| 1 | |
| 2 | <refentry id="exprand"> |
| 3 | <indexterm id="IndexExprandXClass"><primary>x-class noise generators</primary></indexterm> |
| 4 | |
| 5 | <indexterm id="IndexExprand"><primary>exprand</primary></indexterm> |
| 6 | <refentryinfo><title>Signal Generators:Random (Noise) Generators</title></refentryinfo> |
| 7 | <refmeta> |
| 8 | <refentrytitle>exprand</refentrytitle> |
| 9 | </refmeta> |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>exprand</refname> |
| 13 | <refpurpose> |
| 14 | Exponential distribution random number generator (positive values only). |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Exponential distribution random number generator (positive values only). This is an x-class noise generator. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>ares <command>exprand</command> klambda</synopsis> |
| 28 | <synopsis>ires <command>exprand</command> klambda</synopsis> |
| 29 | <synopsis>kres <command>exprand</command> klambda</synopsis> |
| 30 | </refsect1> |
| 31 | |
| 32 | <refsect1> |
| 33 | <title>Performance</title> |
| 34 | <para> |
| 35 | <emphasis>klambda</emphasis> -- reciprocal of lambda parameter for the exponential distribution. |
| 36 | </para> |
| 37 | |
| 38 | <para> |
| 39 | The probablity density function of an exponential distribution |
| 40 | is an exponential curve, whose median is log(2)/lambda. |
| 41 | For more detailed explanation of these distributions, see: |
| 42 | <orderedlist> |
| 43 | <listitem> |
| 44 | <para>C. Dodge - T.A. Jerse 1985. Computer music. Schirmer |
| 45 | books. Second edition, section 11.1B4</para> |
| 46 | </listitem> |
| 47 | |
| 48 | <listitem> |
| 49 | <para>D. Lorrain. A panoply of stochastic cannons. In C. Roads, ed. 1989. Music machine . Cambridge, Massachusetts: MIT press, pp. 351 - 379.</para> |
| 50 | </listitem> |
| 51 | </orderedlist> |
| 52 | </para> |
| 53 | </refsect1> |
| 54 | |
| 55 | <refsect1> |
| 56 | <title>Examples</title> |
| 57 | <para> |
| 58 | Here is an example of the exprand opcode. It uses the file <ulink url="examples/exprand.csd"><citetitle>exprand.csd</citetitle></ulink>. |
| 59 | |
| 60 | <example> |
| 61 | <title>Example of the exprand opcode.</title> |
| 62 | |
| 63 | <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> |
| 64 | <xi:include href="examples-xml/exprand.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 65 | </example> |
| 66 | |
| 67 | Its output should include lines like this: |
| 68 | <screen> |
| 69 | i 1 time 0.00033: 4.09813 |
| 70 | i 1 time 0.20033: 56.39567 |
| 71 | i 1 time 0.40033: 3.23362 |
| 72 | i 1 time 0.60033: 0.24277 |
| 73 | i 1 time 0.80033: 13.71228 |
| 74 | i 1 time 1.00000: 12.71885 |
| 75 | i 1 time 1.20033: 32.36737 |
| 76 | i 1 time 1.40033: 0.29747 |
| 77 | i 1 time 1.60033: 4.04450 |
| 78 | i 1 time 1.80000: 35.75676 |
| 79 | i 1 time 2.00000: 3.69845 |
| 80 | |
| 81 | Seeding from current time 3034472128 |
| 82 | |
| 83 | i 2 time 3.00033: 6.67934 |
| 84 | i 2 time 3.20033: 2.72431 |
| 85 | i 2 time 3.40033: 14.51822 |
| 86 | i 2 time 3.60000: 12.10120 |
| 87 | i 2 time 3.80033: 1.12266 |
| 88 | i 2 time 4.00000: 26.90772 |
| 89 | i 2 time 4.20000: 0.43554 |
| 90 | i 2 time 4.40033: 28.59836 |
| 91 | i 2 time 4.60033: 27.01831 |
| 92 | i 2 time 4.80033: 18.19911 |
| 93 | i 2 time 5.00000: 4.45125</screen> |
| 94 | </para> |
| 95 | </refsect1> |
| 96 | |
| 97 | <refsect1> |
| 98 | <title>See also</title> |
| 99 | <para><link linkend="SiggenNoise"><citetitle>Random (Noise) Generators</citetitle></link></para> |
| 100 | </refsect1> |
| 101 | |
| 102 | <refsect1> |
| 103 | <title>Credits</title> |
| 104 | <para> |
| 105 | <simplelist> |
| 106 | <member>Author: &nameparis;</member> |
| 107 | <member>MIT, Cambridge</member> |
| 108 | <member>1995</member> |
| 109 | </simplelist> |
| 110 | </para> |
| 111 | </refsect1> |
| 112 | </refentry> |