foutir — Outputs i-rate signals from an arbitrary number of channels to a specified file.


foutir output N i-rate signals to a specified file of N channels.


foutir ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN]


ihandle -- a number which specifies this file.

iformat -- a flag to choose output file format:

  • 0 - floating point in text format

  • 1 - 32-bit floating point in binary format

iflag -- choose the mode of writing to the ASCII file (valid only in ASCII mode; in binary mode iflag has no meaning, but it must be present anyway). iflag can be a value chosen among the following:

  • 0 - line of text without instrument prefix

  • 1 - line of text with instrument prefix (see below)

  • 2 - reset the time of instrument prefixes to zero (to be used only in some particular cases. See below)

iout,..., ioutN -- values to be written to the file


fouti and foutir 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 iformat to 0 (text file output) and iflag to 1, which enable the output of a prefix consisting of the strings inum, actiontime, and duration, before the values of iout1...ioutN arguments. The arguments in the prefix refer to instrument number, action time and duration of current note.

The difference between fouti and foutir is that, in the case of fouti, when iflag is set to 1, the duration of the first opcode is undefined (so it is replaced by a dot). Whereas, foutir 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 ihandle value generated by the fiopen opcode. So fouti and foutir can be used to generate a Csound score while playing a realtime session.

Notice that fout and foutk can use either a string containing a file pathname, or a handle-number generated by fiopen. Whereas, with fouti and foutir, the target file can be only specified by means of a handle-number.

See Also

fiopen, fout, fouti, foutk


Author: Gabriel Maldonado

New in Csound version 3.56