| 1 | |
| 2 | <refentry id="GEN18"> |
| 3 | <indexterm id="IndexGEN18"><primary>GEN18</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN18</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN18</refname> |
| 10 | <refpurpose> |
| 11 | Writes composite waveforms made up of pre-existing waveforms. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | Writes composite waveforms made up of pre-existing waveforms. Each contributing waveform requires 4 pfields and can overlap with other waveforms. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>f</command> # time size 18 fna ampa starta finisha fnb ampb startb finishb ...</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 (see <link linkend="f">f</link> statement). |
| 31 | </para> |
| 32 | |
| 33 | <para> |
| 34 | <emphasis>fna, fnb, etc.</emphasis> -- pre-existing table number to be written into the table. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>ampa, ampb, etc.</emphasis> -- strength of wavefoms. These are relative strengths, since the composite waveform may be rescaled later. Negative values are permitted and imply a 180 degree phase shift. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>starta, startb, etc.</emphasis> -- where to start writing the fn into the table. |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | <emphasis>finisha, finishb, etc.</emphasis> -- where to stop writing the fn into the table. The last available location is the power of two - 1. |
| 47 | </para> |
| 48 | </refsect1> |
| 49 | |
| 50 | <refsect1> |
| 51 | <title>Examples</title> |
| 52 | |
| 53 | <para> |
| 54 | <informalexample> |
| 55 | <programlisting> |
| 56 | <emphasis role="stamnt">f</emphasis> 1 0 4096 10 1 |
| 57 | <emphasis role="stamnt">f</emphasis> 2 0 1024 18 1 1 0 511 1 1 512 1023</programlisting> |
| 58 | </informalexample> |
| 59 | |
| 60 | f2 consists of two copies of f1 written in to locations 0-511 and 512-1023. |
| 61 | </para> |
| 62 | <para> |
| 63 | Here is an example of the GEN18 routine. It uses the files <ulink url="examples/gen18.csd"><citetitle>gen18.csd</citetitle></ulink>. |
| 64 | <example> |
| 65 | <title>An example of the GEN18 routine.</title> |
| 66 | <xi:include href="examples-xml/gen18.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 67 | </example> |
| 68 | |
| 69 | <textobject> |
| 70 | <phrase>These are the diagrams of the waveforms generated by GEN18, as used in the example:</phrase> |
| 71 | </textobject> |
| 72 | |
| 73 | <mediaobject> |
| 74 | <imageobject> |
| 75 | <imagedata fileref="images/gen18_1.png" format="PNG"/> |
| 76 | <textobject> |
| 77 | <phrase>f 11 0 8193 18 1 1 0 4096 2 1 4097 8192 - composite waveform made up of a sine wave and a sawtooth</phrase> |
| 78 | </textobject> |
| 79 | </imageobject> |
| 80 | |
| 81 | <caption> |
| 82 | <para>f 11 0 8193 18 1 1 0 4096 2 1 4097 8192 - composite waveform made up of a sine wave and a sawtooth</para> |
| 83 | </caption> |
| 84 | </mediaobject> |
| 85 | |
| 86 | <mediaobject> |
| 87 | <imageobject> |
| 88 | <imagedata fileref="images/gen18_2.png" format="PNG"/> |
| 89 | </imageobject> |
| 90 | |
| 91 | <textobject> |
| 92 | <phrase>f 12 0 8192 18 1 1 0 4096 3 1 4097 8192 - composite waveform made up of a sine wave and a wave of cosine partials</phrase> |
| 93 | </textobject> |
| 94 | |
| 95 | <caption> |
| 96 | <para>f 12 0 8192 18 1 1 0 4096 3 1 4097 8192 - composite waveform made up of a sine wave and a wave of cosine partials</para> |
| 97 | </caption> |
| 98 | </mediaobject> |
| 99 | |
| 100 | <mediaobject> |
| 101 | <imageobject> |
| 102 | <imagedata fileref="images/gen18_3.png" format="PNG"/> |
| 103 | </imageobject> |
| 104 | |
| 105 | <textobject> |
| 106 | <phrase>f 13 0 1024 18 1 0.7 0 767 3 0.7 512 1023 - sine+cosine partials overlapped, also shorter table than f12</phrase> |
| 107 | </textobject> |
| 108 | |
| 109 | <caption> |
| 110 | <para>f 13 0 1024 18 1 0.7 0 767 3 0.7 512 1023 - sine+cosine partials overlapped, also shorter table than f12</para> |
| 111 | </caption> |
| 112 | </mediaobject> |
| 113 | </para> |
| 114 | </refsect1> |
| 115 | |
| 116 | <refsect1> |
| 117 | <title>Deprecated Names</title> |
| 118 | <para> |
| 119 | <emphasis>GEN18</emphasis> was called <emphasis>GEN22</emphasis> in version 4.18. The name was changed due to a conflict with DirectCsound. |
| 120 | </para> |
| 121 | </refsect1> |
| 122 | |
| 123 | <refsect1> |
| 124 | <title>Credits</title> |
| 125 | <para> |
| 126 | <simplelist> |
| 127 | <member>Author: William <quote>Pete</quote> Moss</member> |
| 128 | <member>University of Texas at Austin</member> |
| 129 | <member>Austin, Texas USA</member> |
| 130 | <member>January 2002</member> |
| 131 | </simplelist> |
| 132 | </para> |
| 133 | |
| 134 | <para>New in version 4.18, changed in version 4.19</para> |
| 135 | </refsect1> |
| 136 | </refentry> |