| 1 | |
| 2 | <refentry id="GEN25"> |
| 3 | <indexterm id="IndexGEN25"><primary>GEN25</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN25</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN25</refname> |
| 10 | <refpurpose> |
| 11 | Construct functions from segments of exponential curves in breakpoint fashion. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | These subroutines are used to construct functions from segments of exponential curves in breakpoint fashion. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>f</command> # time size 25 x1 y1 x2 y2 x3 ...</synopsis> |
| 25 | </refsect1> |
| 26 | |
| 27 | <refsect1> |
| 28 | <title>Initialization</title> |
| 29 | <para> |
| 30 | <emphasis>size </emphasis> -- number of points in the table. Must be a power of 2 or power-of-2 plus 1 (see <link linkend="f"><citetitle>f statement</citetitle></link>). |
| 31 | </para> |
| 32 | |
| 33 | <para> |
| 34 | <emphasis>x1, x2, x3,</emphasis> etc. -- locations in table at which to attain the following y value. Must be in increasing order. If the last value is less than size, then the rest will be set to zero. Should not be negative but can be zero. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>y1, y2, y3,</emphasis>, etc. -- Breakpoint values attained at the location specified by the preceding x value. These must be non-zero and must be alike in sign. |
| 39 | </para> |
| 40 | |
| 41 | <note> |
| 42 | <title>Note</title> |
| 43 | <para> |
| 44 | If p4 is positive, functions are post-normalized (rescaled to a maximum absolute value of 1 after generation). A negative p4 will cause rescaling to be skipped. |
| 45 | </para> |
| 46 | </note> |
| 47 | </refsect1> |
| 48 | |
| 49 | <refsect1> |
| 50 | <title>Examples</title> |
| 51 | <para> |
| 52 | Here is an example of the GEN25 generator. It uses the file <ulink url="examples/gen25.csd"><citetitle>gen25.csd</citetitle></ulink>. |
| 53 | <example> |
| 54 | <title>Example of the GEN25 generator.</title> |
| 55 | <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> |
| 56 | <xi:include href="examples-xml/gen25.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 57 | </example> |
| 58 | <textobject> |
| 59 | <phrase>This is the diagram of the waveform of the GEN25 routine, as used in the example:</phrase> |
| 60 | </textobject> |
| 61 | |
| 62 | <mediaobject> |
| 63 | <imageobject> |
| 64 | <imagedata fileref="images/gen25.png" format="PNG"/> |
| 65 | </imageobject> |
| 66 | |
| 67 | <textobject> |
| 68 | <phrase>f 2 0 1025 25 0 0.01 200 1 400 1 513 0.01 - a function which begins at 0.01, rises to 1 at the 200th table location, makes a straight line to the 400th location, and returns to 0.01 by the end of the table</phrase> |
| 69 | </textobject> |
| 70 | |
| 71 | <caption> |
| 72 | <para>f 2 0 1025 25 0 0.01 200 1 400 1 513 0.01 - a function which begins at 0.01, rises to 1 at the 200th table location, makes a straight line to the 400th location, and returns to 0.01 by the end of the table</para> |
| 73 | </caption> |
| 74 | </mediaobject> |
| 75 | |
| 76 | </para> |
| 77 | </refsect1> |
| 78 | |
| 79 | <refsect1> |
| 80 | <title>See Also</title> |
| 81 | <para> |
| 82 | <link linkend="f"><citetitle>f statement</citetitle></link>, |
| 83 | <link linkend="GEN27"><citetitle>GEN27</citetitle></link> |
| 84 | </para> |
| 85 | </refsect1> |
| 86 | |
| 87 | <refsect1> |
| 88 | <title>Credits</title> |
| 89 | <para> |
| 90 | <simplelist> |
| 91 | <member>Author: &namejohn;</member> |
| 92 | <member>University of Bath/Codemist Ltd.</member> |
| 93 | <member>Bath, UK</member> |
| 94 | </simplelist> |
| 95 | </para> |
| 96 | |
| 97 | <para>New in Csound version 3.49</para> |
| 98 | </refsect1> |
| 99 | </refentry> |