summaryrefslogtreecommitdiff
path: root/opcodes/foutir.xml
blob: 5efaf21906c229287314d056f02f4561b83d53b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<refentry id="foutir">
<indexterm id="IndexFoutir"><primary>foutir</primary></indexterm>
  <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo>
  <refmeta>
    <refentrytitle>foutir</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>foutir</refname>
    <refpurpose>
      Outputs i-rate signals from an arbitrary number of channels to a specified file.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>foutir</emphasis> output <emphasis>N</emphasis> i-rate signals to a specified file of <emphasis>N</emphasis> channels.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>foutir</command> ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ihandle</emphasis> -- a number which specifies this file.
    </para>

    <para>
      <emphasis>iformat</emphasis> -- a flag to choose output file format:
      <itemizedlist>
        <listitem>
          <para>0 - floating point in text format</para>
        </listitem>

        <listitem>
          <para>1 - 32-bit floating point in binary format</para>
        </listitem>
      </itemizedlist>
    </para>

    <para>
      <emphasis>iflag</emphasis> -- choose the mode of writing to the ASCII file (valid only in ASCII mode; in binary mode <emphasis>iflag</emphasis> has no meaning, but it must be present anyway). <emphasis>iflag</emphasis> can be a value chosen among the following:
      <itemizedlist>
        <listitem>
          <para>0 - line of text without instrument prefix</para>
        </listitem>

        <listitem>
          <para>1 - line of text with instrument prefix (see below)</para>
        </listitem>

        <listitem>
          <para>2 - reset the time of instrument prefixes to zero (to be used only in some particular cases. See below)</para>
        </listitem>
      </itemizedlist>
    </para>

    <para>
      <emphasis>iout,..., ioutN</emphasis> -- values to be written to the file
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <link linkend="fouti"><citetitle>fouti</citetitle></link> and <emphasis>foutir</emphasis> write i-rate values to a file. The main use of these opcodes is to generate a score file during a realtime session. For this purpose, the user should set <emphasis>iformat</emphasis> to 0 (text file output) and <emphasis>iflag</emphasis> to 1, which enable the output of a prefix consisting of the strings <emphasis>inum</emphasis>, <emphasis>actiontime</emphasis>, and <emphasis>duration</emphasis>, before the values of <emphasis>iout1...ioutN</emphasis> arguments. The arguments in the prefix refer to instrument number, action time and duration of current note.
    </para>

    <para>
      The difference between <link linkend="fouti"><citetitle>fouti</citetitle></link> and <emphasis>foutir</emphasis> is that, in the case of <emphasis>fouti</emphasis>, when <emphasis>iflag</emphasis> is set to 1, the duration of the first opcode is undefined (so it is replaced by a dot). Whereas, <emphasis>foutir</emphasis> is defined at the end of note, so the corresponding text line is written only at the end of the current note (in order to recognize its duration). The corresponding file is linked by the <emphasis>ihandle</emphasis> value generated by the <link linkend="fiopen"><citetitle>fiopen</citetitle></link> opcode. So <emphasis>fouti</emphasis> and <emphasis>foutir</emphasis> can be used to generate a Csound score while playing  a realtime session.
    </para>

    <para>
      Notice that <link linkend="fout"><citetitle>fout</citetitle></link> and <link linkend="foutk"><citetitle>foutk</citetitle></link> can use either a string containing a file pathname, or a handle-number generated by <link linkend="fiopen"><citetitle>fiopen</citetitle></link>. Whereas, with <link linkend="fouti"><citetitle>fouti</citetitle></link> and <emphasis>foutir</emphasis>, the target file can be only specified by means of a handle-number.
    </para>
  </refsect1>
    
    <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the foutir opcode. It uses the file <ulink url="examples/foutir.csd"><citetitle>foutir.csd</citetitle></ulink>and creates a list "foutir.sco". It can be used as a score file.
      <example>
        <title>Example of the foutir opcode.</title>
        <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>
          <xi:include href="examples-xml/foutir.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="fiopen"><citetitle>fiopen</citetitle></link>,
      <link linkend="fout"><citetitle>fout</citetitle></link>,
      <link linkend="fouti"><citetitle>fouti</citetitle></link>,
      <link linkend="foutk"><citetitle>foutk</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namegabriel;</member>
        <member>Italy</member>
        <member>1999</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.56</para>
  </refsect1>
</refentry>