| 1 | |
| 2 | <refentry id="betarand"> |
| 3 | <indexterm id="IndexBetarandXClass"><primary>x-class noise generators</primary></indexterm> |
| 4 | |
| 5 | <indexterm id="IndexBetarand"><primary>betarand</primary></indexterm> |
| 6 | <refentryinfo><title>Signal Generators:Random (Noise) Generators</title></refentryinfo> |
| 7 | <refmeta> |
| 8 | <refentrytitle>betarand</refentrytitle> |
| 9 | </refmeta> |
| 10 | <refnamediv> |
| 11 | <refname>betarand</refname> |
| 12 | <refpurpose> |
| 13 | Beta distribution random number generator (positive values only). |
| 14 | </refpurpose> |
| 15 | </refnamediv> |
| 16 | |
| 17 | <refsect1> |
| 18 | <title>Description</title> |
| 19 | <para> |
| 20 | Beta distribution random number generator (positive values only). This is an x-class noise generator. |
| 21 | </para> |
| 22 | </refsect1> |
| 23 | |
| 24 | <refsect1> |
| 25 | <title>Syntax</title> |
| 26 | <synopsis>ares <command>betarand</command> krange, kalpha, kbeta</synopsis> |
| 27 | |
| 28 | <synopsis>ires <command>betarand</command> krange, kalpha, kbeta</synopsis> |
| 29 | |
| 30 | <synopsis>kres <command>betarand</command> krange, kalpha, kbeta</synopsis> |
| 31 | </refsect1> |
| 32 | |
| 33 | <refsect1> |
| 34 | <title>Performance</title> |
| 35 | <para> |
| 36 | <emphasis>krange</emphasis> -- range of the random numbers (0 - <emphasis>krange</emphasis>). |
| 37 | </para> |
| 38 | |
| 39 | <para> |
| 40 | <emphasis>kalpha</emphasis> -- alpha value. If <emphasis>kalpha</emphasis> is smaller than one, smaller values favor values near 0. |
| 41 | </para> |
| 42 | |
| 43 | <para> |
| 44 | <emphasis>kbeta</emphasis> -- beta value. If <emphasis>kbeta</emphasis> is smaller than one, smaller values favor values near <emphasis>krange</emphasis>. |
| 45 | </para> |
| 46 | |
| 47 | <para> |
| 48 | If both <emphasis>kalpha</emphasis> and <emphasis>kbeta</emphasis> equal one we have uniform distribution. If both <emphasis>kalpha</emphasis> and <emphasis>kbeta</emphasis> are greater than one we have a sort of Gaussian distribution. Outputs only positive numbers. |
| 49 | </para> |
| 50 | |
| 51 | <para> |
| 52 | For more detailed explanation of these distributions, see: |
| 53 | <orderedlist> |
| 54 | <listitem> |
| 55 | <para>C. Dodge - T.A. Jerse 1985. Computer music. Schirmer books. pp.265 - 286</para> |
| 56 | </listitem> |
| 57 | |
| 58 | <listitem> |
| 59 | <para>D. Lorrain. A panoply of stochastic cannons. In C. Roads, ed. 1989. Music machine . Cambridge, Massachusetts: MIT press, pp. 351 - 379.</para> |
| 60 | </listitem> |
| 61 | </orderedlist> |
| 62 | </para> |
| 63 | </refsect1> |
| 64 | |
| 65 | <refsect1> |
| 66 | <title>Examples</title> |
| 67 | <para> |
| 68 | Here is an example of the betarand opcode. It uses the file <ulink url="examples/betarand.csd"><citetitle>betarand.csd</citetitle></ulink>. |
| 69 | |
| 70 | <example> |
| 71 | <title>Example of the betarand opcode.</title> |
| 72 | <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> |
| 73 | <xi:include href="examples-xml/betarand.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 74 | </example> |
| 75 | |
| 76 | Its output should include a line like: |
| 77 | <screen> |
| 78 | i 1 time 0.00267: 85.74227 |
| 79 | i 1 time 0.20267: 12.07606 |
| 80 | i 1 time 0.40267: 25.03239 |
| 81 | i 1 time 0.60267: 0.42037 |
| 82 | i 1 time 0.80267: 76.69589 |
| 83 | i 1 time 1.00000: 29.73339 |
| 84 | i 1 time 1.20267: 48.29811 |
| 85 | i 1 time 1.40267: 75.46507 |
| 86 | i 1 time 1.60267: 74.80686 |
| 87 | i 1 time 1.80000: 81.37473 |
| 88 | i 1 time 2.00000: 55.48827 |
| 89 | Seeding from current time 3472120656 |
| 90 | i 2 time 3.00267: 57.21408 |
| 91 | i 2 time 3.20267: 30.95705 |
| 92 | i 2 time 3.40267: 19.71687 |
| 93 | i 2 time 3.60000: 64.48965 |
| 94 | i 2 time 3.80267: 72.35818 |
| 95 | i 2 time 4.00000: 49.65395 |
| 96 | i 2 time 4.20000: 55.25888 |
| 97 | i 2 time 4.40267: 3.98308 |
| 98 | i 2 time 4.60267: 52.98075 |
| 99 | i 2 time 4.80267: 58.07925 |
| 100 | i 2 time 5.00000: 56.38914 |
| 101 | </screen> |
| 102 | </para> |
| 103 | </refsect1> |
| 104 | |
| 105 | <refsect1> |
| 106 | <title>See also</title> |
| 107 | <para><link linkend="SiggenNoise"><citetitle>Random (Noise) Generators</citetitle></link></para> |
| 108 | </refsect1> |
| 109 | |
| 110 | <refsect1> |
| 111 | <title>Credits</title> |
| 112 | <para> |
| 113 | <simplelist> |
| 114 | <member>Author: &nameparis;</member> |
| 115 | <member>MIT, Cambridge</member> |
| 116 | <member>1995</member> |
| 117 | </simplelist> |
| 118 | </para> |
| 119 | <para>Existed in 3.30</para> |
| 120 | </refsect1> |
| 121 | </refentry> |