| 1 | |
| 2 | <refentry id="GEN28"> |
| 3 | <indexterm id="IndexGEN28"><primary>GEN28</primary></indexterm> |
| 4 | <refmeta> |
| 5 | <refentrytitle>GEN28</refentrytitle> |
| 6 | </refmeta> |
| 7 | |
| 8 | <refnamediv> |
| 9 | <refname>GEN28</refname> |
| 10 | <refpurpose> |
| 11 | Reads a text file which contains a time-tagged trajectory. |
| 12 | </refpurpose> |
| 13 | </refnamediv> |
| 14 | |
| 15 | <refsect1> |
| 16 | <title>Description</title> |
| 17 | <para> |
| 18 | This function generator reads a text file which contains sets of three values representing the xy coordinates and a time-tag for when the signal should be placed at that location, allowing the user to define a time-tagged trajectory. The file format is in the form: |
| 19 | <literallayout> |
| 20 | time1 X1 Y1 |
| 21 | time2 X2 Y2 |
| 22 | time3 X3 Y3 |
| 23 | </literallayout> |
| 24 | </para> |
| 25 | |
| 26 | <para> |
| 27 | The configuration of the xy coordinates in space places the signal in the following way: |
| 28 | |
| 29 | <itemizedlist> |
| 30 | <listitem> |
| 31 | <para>a1 is -1, 1</para> |
| 32 | </listitem> |
| 33 | <listitem> |
| 34 | <para>a2 is 1, 1</para> |
| 35 | </listitem> |
| 36 | <listitem> |
| 37 | <para>a3 is -1, -1</para> |
| 38 | </listitem> |
| 39 | <listitem> |
| 40 | <para>a4 is 1, -1</para> |
| 41 | </listitem> |
| 42 | </itemizedlist> |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | This assumes a loudspeaker set up as a1 is left front, a2 is right front, a3 is left back, a4 is right back. Values greater than 1 will result in sounds being attenuated as if in the distance. <emphasis>GEN28</emphasis> creates values to 10 milliseconds of resolution. |
| 47 | </para> |
| 48 | </refsect1> |
| 49 | |
| 50 | <refsect1> |
| 51 | <title>Syntax</title> |
| 52 | <synopsis><command>f</command> # time size 28 ifilcod</synopsis> |
| 53 | </refsect1> |
| 54 | |
| 55 | <refsect1> |
| 56 | <title>Initialization</title> |
| 57 | <para> |
| 58 | <emphasis>size</emphasis> -- number of points in the table. Must be 0. <emphasis>GEN28</emphasis> takes 0 as the size and automatically allocates memory. |
| 59 | </para> |
| 60 | |
| 61 | <para> |
| 62 | <emphasis>ifilcod</emphasis> -- character-string denoting the source file name. A character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought in the current directory. |
| 63 | </para> |
| 64 | </refsect1> |
| 65 | |
| 66 | <refsect1> |
| 67 | <title>Examples</title> |
| 68 | <para> |
| 69 | <informalexample> |
| 70 | <programlisting><emphasis role="stamnt">f</emphasis>1 0 0 28 "move"</programlisting> |
| 71 | </informalexample> |
| 72 | </para> |
| 73 | |
| 74 | <para> |
| 75 | The file "move" should look like: |
| 76 | |
| 77 | <literallayout> |
| 78 | 0 -1 1 |
| 79 | 1 1 1 |
| 80 | 2 4 4 |
| 81 | 2.1 -4 -4 |
| 82 | 3 10 -10 |
| 83 | 5 -40 0 |
| 84 | </literallayout> |
| 85 | |
| 86 | Since <emphasis>GEN28</emphasis> creates values to 10 milliseconds of resolution, there will be 500 values created by interpolating X1 to X2 to X3 and so on, and Y1 to Y2 to Y3 and so on, over the appropriate number of values that are stored in the function table. The sound will begin in the left front, over 1 second it will move to the right front, over another second it move further into the distance but still in the right front, then in just 1/10th of a second it moves to the left rear, a bit distant. Finally over the last .9 seconds the sound will move to the right rear, moderately distant, and it comes to rest between the two left channels (due west!), quite distant. |
| 87 | </para> |
| 88 | <para> |
| 89 | Here is an example of the GEN28 routine. It uses the file <ulink url="examples/gen28.csd"><citetitle>gen28.csd</citetitle></ulink>. |
| 90 | <example> |
| 91 | <title>Example of the gen28 generator.</title> |
| 92 | <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> |
| 93 | <xi:include href="examples-xml/gen28.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 94 | </example> |
| 95 | </para> |
| 96 | </refsect1> |
| 97 | |
| 98 | <refsect1> |
| 99 | <title>Credits</title> |
| 100 | <para> |
| 101 | <simplelist> |
| 102 | <member>Author: Richard Karpen</member> |
| 103 | <member>Seattle, Wash</member> |
| 104 | <member>1998</member> |
| 105 | </simplelist> |
| 106 | </para> |
| 107 | |
| 108 | <para>New in Csound version 3.48</para> |
| 109 | </refsect1> |
| 110 | </refentry> |