| 1 | |
| 2 | <refentry id="GEN41"> |
| 3 | <indexterm id="IndexGEN41"><primary>GEN41</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN41</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN41</refname> |
| 10 | <refpurpose> |
| 11 | Generates a random list of numerical pairs. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | Generates a discrete random distribution function by giving a list of numerical pairs. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>f</command> # time size -41 value1 prob1 value2 prob2 value3 prob3 ... valueN probN </synopsis> |
| 25 | </refsect1> |
| 26 | |
| 27 | <refsect1> |
| 28 | <title>Performance</title> |
| 29 | <para> |
| 30 | The first number of each pair is a value, and the second is the probability of that value to be chosen by a random algorithm. Even if any number can be assigned to the probability element of each pair, it is suggested to give it a percent value, in order to make it clearer for the user. |
| 31 | </para> |
| 32 | |
| 33 | <para> |
| 34 | This subroutine is designed to be used together with duserrnd and <link linkend="urd"><citetitle>urd</citetitle></link> opcodes (see <link linkend="duserrnd">duserrnd</link> for more information). |
| 35 | </para> |
| 36 | </refsect1> |
| 37 | |
| 38 | <refsect1> |
| 39 | <title>Examples</title> |
| 40 | <para> |
| 41 | Here is an example of the GEN41 generator. It uses the file <ulink url="examples/gen41.csd"><citetitle>gen41.csd</citetitle></ulink>. |
| 42 | <example> |
| 43 | <title>Example of the GEN41 generator.</title> |
| 44 | <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> |
| 45 | <xi:include href="examples-xml/gen41.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 46 | </example> |
| 47 | Its output should include lines like these: |
| 48 | <screen> |
| 49 | i 1 time 0.00067: 8.00000 |
| 50 | i 1 time 0.00133: 8.00000 |
| 51 | i 1 time 0.00200: 8.00000 |
| 52 | i 1 time 0.00267: 8.00000 |
| 53 | i 1 time 0.00333: 2.00000 |
| 54 | i 1 time 0.00400: 8.00000 |
| 55 | i 1 time 0.00533: 8.00000 |
| 56 | i 1 time 0.00600: 8.00000 |
| 57 | .......... |
| 58 | </screen> |
| 59 | |
| 60 | <textobject> |
| 61 | <phrase>This is the diagram of the waveform of the GEN41 routine, as used in the example:</phrase> |
| 62 | </textobject> |
| 63 | <para> |
| 64 | </para> |
| 65 | <mediaobject> |
| 66 | <imageobject> |
| 67 | <imagedata fileref="images/gen41.png" format="PNG"/> |
| 68 | </imageobject> |
| 69 | |
| 70 | <textobject> |
| 71 | <phrase>f 1 0 -20 -41 2 .1 8 .9</phrase> |
| 72 | </textobject> |
| 73 | |
| 74 | <caption> |
| 75 | <para>f 1 0 -20 -41 2 .1 8 .9</para> |
| 76 | </caption> |
| 77 | </mediaobject> |
| 78 | |
| 79 | </para> |
| 80 | </refsect1> |
| 81 | |
| 82 | <refsect1> |
| 83 | <title>Credits</title> |
| 84 | <para>Author: &namegabriel;</para> |
| 85 | </refsect1> |
| 86 | </refentry> |