| 1 | |
| 2 | <refentry id="GEN52"> |
| 3 | <indexterm id="IndexGEN52"><primary>GEN52</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN52</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN52</refname> |
| 10 | <refpurpose> |
| 11 | Creates an interleaved multichannel table from the specified |
| 12 | source tables, in the format expected by the <emphasis>ftconv</emphasis> opcode. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | GEN52 creates an interleaved multichannel table from the specified |
| 20 | source tables, in the format expected by the <link linkend="ftconv"><citetitle>ftconv</citetitle></link> opcode. |
| 21 | It can also be used to extract a channel from a multichannel table |
| 22 | and store it in a normal mono table, copy tables with skipping some |
| 23 | samples, adding delay, or store in reverse order, etc. |
| 24 | </para> |
| 25 | <para> |
| 26 | Three parameters must be given for each channel to be processed. <emphasis>fsrc</emphasis> declares the source f-table number. The parameter <emphasis>offset</emphasis> specifies an offset for the source file. If different to 0, the source file is not read from the beginning, but the <emphasis>offset</emphasis> number of values are skipped. The <emphasis>offset</emphasis> is used to determine the channel number to be read from interleaved f-tables, e.g. for channel 2, <emphasis>offset</emphasis> must be 1. It can also be used to set a read offset on the source table. This parameter gives absolute values, so if a skip of 20 sample frames for a 2 channel f-table is desired, <emphasis>offset</emphasis> must be set to 40. The <emphasis>srcchnls</emphasis> parameter is used to declare the number of channels in the source f-table. This parameter sets the skip size when reading the source f-table. |
| 27 | </para> |
| 28 | <para> |
| 29 | When more than one channel (<emphasis>nchannels</emphasis> > 1) is given, source f-tables are interleaved in the newly created table. |
| 30 | </para> |
| 31 | <para> |
| 32 | If the source f-table is finished before the destination f-table is full, the remaining values are set to 0. |
| 33 | </para> |
| 34 | </refsect1> |
| 35 | |
| 36 | <refsect1> |
| 37 | <title>Syntax</title> |
| 38 | <synopsis><command>f</command> # time size 52 nchannels fsrc1 offset1 srcchnls1 [fsrc2 offset2 srcchnls2 ... fsrcN offsetN srcchnlsN]</synopsis> |
| 39 | </refsect1> |
| 40 | |
| 41 | <refsect1> |
| 42 | <title>Example</title> |
| 43 | <programlisting> |
| 44 | <emphasis role="comment">; source tables</emphasis> |
| 45 | <emphasis role="stamnt">f</emphasis> 1 0 16384 10 1 |
| 46 | <emphasis role="stamnt">f</emphasis> 2 0 16384 10 0 1 |
| 47 | <emphasis role="comment">; create 2 channel interleaved table</emphasis> |
| 48 | <emphasis role="stamnt">f</emphasis> 3 0 32768 -52 2 1 0 1 2 0 1 |
| 49 | <emphasis role="comment">; extract first channel from table 3</emphasis> |
| 50 | <emphasis role="stamnt">f</emphasis> 4 0 16384 -52 1 3 0 2 |
| 51 | <emphasis role="comment">; extract second channel from table 3</emphasis> |
| 52 | <emphasis role="stamnt">f</emphasis> 5 0 16384 -52 1 3 1 2</programlisting> |
| 53 | <para> |
| 54 | Here is a complete example of the GEN52 generator. It uses the file <ulink url="examples/gen52.csd"><citetitle>gen52.csd</citetitle></ulink>. |
| 55 | <example> |
| 56 | <title>Example of the GEN52 generator.</title> |
| 57 | <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> |
| 58 | <xi:include href="examples-xml/gen52.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 59 | </example> |
| 60 | <textobject> |
| 61 | <phrase>This is the diagram of the waveform of the GEN52 routine, as used in the example:</phrase> |
| 62 | </textobject> |
| 63 | |
| 64 | <mediaobject> |
| 65 | <imageobject> |
| 66 | <imagedata fileref="images/gen52.png" format="PNG"/> |
| 67 | </imageobject> |
| 68 | |
| 69 | <textobject> |
| 70 | <phrase>f 3 0 262144 -52 3 2 0 4 2 1 4 2 2 4</phrase> |
| 71 | </textobject> |
| 72 | |
| 73 | <caption> |
| 74 | <para>f 3 0 262144 -52 3 2 0 4 2 1 4 2 2 4</para> |
| 75 | </caption> |
| 76 | </mediaobject> |
| 77 | |
| 78 | </para> |
| 79 | </refsect1> |
| 80 | <refsect1> |
| 81 | <title>Credits</title> |
| 82 | <para>Author: &nameistvan;</para> |
| 83 | </refsect1> |
| 84 | </refentry> |