| 1 | |
| 2 | <refentry id="fini"> |
| 3 | <indexterm id="IndexFini"><primary>fini</primary></indexterm> |
| 4 | <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>fini</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>fini</refname> |
| 13 | <refpurpose> |
| 14 | Read signals from a file at i-rate. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Read signals from a file at i-rate. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis><command>fini</command> ifilename, iskipframes, iformat, in1 [, in2] [, in3] [, ...]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>ifilename</emphasis> -- input file name (can be a string or a handle number generated by <link linkend="fiopen"><citetitle>fiopen</citetitle></link>) |
| 34 | </para> |
| 35 | |
| 36 | <para> |
| 37 | <emphasis>iskipframes</emphasis> -- number of frames to skip at the start (every frame contains a sample of each channel) |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis>iformat</emphasis> -- a number specifying the input file format. If a header is found, this argument is ignored. |
| 42 | <itemizedlist> |
| 43 | <listitem> |
| 44 | <para>0 - floating points in text format (loop; see below)</para> |
| 45 | </listitem> |
| 46 | |
| 47 | <listitem> |
| 48 | <para>1 - floating points in text format (no loop; see below)</para> |
| 49 | </listitem> |
| 50 | |
| 51 | <listitem> |
| 52 | <para>2 - 32 bit floating points in binary format (no loop)</para> |
| 53 | </listitem> |
| 54 | </itemizedlist> |
| 55 | </para> |
| 56 | </refsect1> |
| 57 | |
| 58 | <refsect1> |
| 59 | <title>Performance</title> |
| 60 | <para> |
| 61 | <emphasis>fini</emphasis> is the complement of <link linkend="fouti"><citetitle>fouti</citetitle></link> and <link linkend="foutir"><citetitle>foutir</citetitle></link>. It reads the values each time the corresponding instrument note is activated. When <emphasis>iformat</emphasis> is set to 0 and the end of file is reached, the file pointer is zeroed. This restarts the scan from the beginning. When <emphasis>iformat</emphasis> is set to 1 or 2, no looping is enabled and at the end of file the corresponding variables will be filled with zeroes. |
| 62 | </para> |
| 63 | <note> |
| 64 | <para>Please note that since this opcode generates its output using input parameters (on the right side of the opcode), these variables must be initialized before use, otherwise a 'used before defined' error will occur. You can use the <link linkend="init"><citetitle>init</citetitle></link> opcode for this.</para> |
| 65 | </note> |
| 66 | </refsect1> |
| 67 | |
| 68 | <refsect1> |
| 69 | <title>Examples</title> |
| 70 | <para> |
| 71 | Here is an example of the fini opcode. It uses the file <ulink url="examples/fini.csd"><citetitle>fini.csd</citetitle></ulink>. |
| 72 | <example> |
| 73 | <title>Example of the fini opcode.</title> |
| 74 | <para>See the sections <link |
| 75 | linkend="UsingRealTime"><citetitle>Real-time |
| 76 | Audio</citetitle></link> and <link |
| 77 | linkend="CommandFlags"><citetitle>Command Line |
| 78 | Flags</citetitle></link> for more information on using command |
| 79 | line flags.</para> |
| 80 | <para> Note that this example requires the file test.txt to be |
| 81 | created, for example by <emphasis>fouti</emphasis></para> |
| 82 | <xi:include href="examples-xml/fini.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 83 | </example> |
| 84 | </para> |
| 85 | </refsect1> |
| 86 | |
| 87 | <refsect1> |
| 88 | <title>See also</title> |
| 89 | <para><link linkend="SigioFileIO"><citetitle>File Input and Output</citetitle></link></para> |
| 90 | </refsect1> |
| 91 | |
| 92 | <refsect1> |
| 93 | <title>Credits</title> |
| 94 | <para> |
| 95 | <simplelist> |
| 96 | <member>Author: &namegabriel;</member> |
| 97 | <member>Italy</member> |
| 98 | <member>1999</member> |
| 99 | </simplelist> |
| 100 | </para> |
| 101 | |
| 102 | <para>New in Csound version 3.56</para> |
| 103 | </refsect1> |
| 104 | </refentry> |