| 1 | |
| 2 | <refentry id="GEN10"> |
| 3 | <indexterm id="IndexGEN10"><primary>GEN10</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN10</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN10</refname> |
| 10 | <refpurpose> |
| 11 | Generate composite waveforms made up of weighted sums of simple sinusoids. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | These subroutines generate composite waveforms made up of weighted sums of simple sinusoids. The specification of each contributing partial requires 1 pfield using <emphasis>GEN10</emphasis>. |
| 19 | </para> |
| 20 | </refsect1> |
| 21 | |
| 22 | <refsect1> |
| 23 | <title>Syntax</title> |
| 24 | <synopsis><command>f</command> # time size 10 str1 str2 str3 str4 ...</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>str1, str2, str3, etc.</emphasis> -- relative strengths of the fixed harmonic partial numbers 1,2,3, etc., beginning in p5. Partials not required should be given a strength of zero. |
| 35 | </para> |
| 36 | |
| 37 | <note> |
| 38 | <title>Note</title> |
| 39 | <para> |
| 40 | <itemizedlist> |
| 41 | <listitem> |
| 42 | <para> |
| 43 | These subroutines generate stored functions as sums of sinusoids of different frequencies. The two major restrictions on <emphasis>GEN10</emphasis> that the partials be harmonic and in phase do not apply to <emphasis>GEN09</emphasis> or <emphasis>GEN19</emphasis>. |
| 44 | </para> |
| 45 | |
| 46 | <para> |
| 47 | In each case the composite wave, once drawn, is then rescaled to unity if p4 was positive. A negative p4 will cause rescaling to be skipped. |
| 48 | </para> |
| 49 | </listitem> |
| 50 | </itemizedlist> |
| 51 | </para> |
| 52 | </note> |
| 53 | </refsect1> |
| 54 | |
| 55 | <refsect1> |
| 56 | <title>Examples</title> |
| 57 | <para> |
| 58 | Here is an example of the GEN10 routine. It uses the files <ulink url="examples/gen10.csd"><citetitle>gen10.csd</citetitle></ulink>. |
| 59 | <example> |
| 60 | <title>An example of the GEN10 routine.</title> |
| 61 | <xi:include href="examples-xml/gen10.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 62 | </example> |
| 63 | |
| 64 | <textobject> |
| 65 | <phrase>These are the diagrams of the waveforms of the GEN10 routines, as used in the example:</phrase> |
| 66 | </textobject> |
| 67 | |
| 68 | <mediaobject> |
| 69 | <imageobject> |
| 70 | <imagedata fileref="images/gen10_1.png" format="PNG"/> |
| 71 | </imageobject> |
| 72 | |
| 73 | <textobject> |
| 74 | <phrase>f 1 0 16384 10 1 - sine wave with only the fundamental frequency</phrase> |
| 75 | </textobject> |
| 76 | |
| 77 | <caption> |
| 78 | <para>f 1 0 16384 10 1 - sine wave with only the fundamental frequency</para> |
| 79 | </caption> |
| 80 | </mediaobject> |
| 81 | |
| 82 | <mediaobject> |
| 83 | <imageobject> |
| 84 | <imagedata fileref="images/gen10_2.png" format="PNG"/> |
| 85 | </imageobject> |
| 86 | |
| 87 | <textobject> |
| 88 | <phrase>f 2 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111 - sawtooth, with a fundamental and 8 harmonics </phrase> |
| 89 | </textobject> |
| 90 | |
| 91 | <caption> |
| 92 | <para>f 2 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111 - sawtooth, with a fundamental and 8 harmonics </para> |
| 93 | </caption> |
| 94 | </mediaobject> |
| 95 | |
| 96 | <mediaobject> |
| 97 | <imageobject> |
| 98 | <imagedata fileref="images/gen10_3.png" format="PNG"/> |
| 99 | </imageobject> |
| 100 | |
| 101 | <textobject> |
| 102 | <phrase>f 3 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111 - square wave, with a fundamental and 8 harmonics but 4 have 0 strength</phrase> |
| 103 | </textobject> |
| 104 | |
| 105 | <caption> |
| 106 | <para>f 3 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111 - square wave, with a fundamental and 8 harmonics but 4 have 0 strength</para> |
| 107 | </caption> |
| 108 | </mediaobject> |
| 109 | |
| 110 | <mediaobject> |
| 111 | <imageobject> |
| 112 | <imagedata fileref="images/gen10_4.png" format="PNG"/> |
| 113 | </imageobject> |
| 114 | |
| 115 | <textobject> |
| 116 | <phrase>f 4 0 16384 10 1 1 1 1 0.7 0.5 0.3 0.1 - pulse wave, with a fundamental and 8 harmonics</phrase> |
| 117 | </textobject> |
| 118 | |
| 119 | <caption> |
| 120 | <para>f 4 0 16384 10 1 1 1 1 0.7 0.5 0.3 0.1 - pulse wave, with a fundamental and 8 harmonics</para> |
| 121 | </caption> |
| 122 | </mediaobject> |
| 123 | </para> |
| 124 | </refsect1> |
| 125 | |
| 126 | <refsect1> |
| 127 | <title>See Also</title> |
| 128 | <para> |
| 129 | <link linkend="GEN09"><citetitle>GEN09</citetitle></link>, |
| 130 | <link linkend="GEN11"><citetitle>GEN11</citetitle></link>, and |
| 131 | <link linkend="GEN19"><citetitle>GEN19</citetitle></link>. |
| 132 | </para> |
| 133 | </refsect1> |
| 134 | |
| 135 | </refentry> |