readfSignal I/O:File I/Oreadfreadf
Read a line of text from an external file.
DescriptionPlugin opcode in cs_date.
Read a line of text from an external file once each k-cycle.
SyntaxSres, kline readf ifilnameInitializationifilname -- an integer N denoting a file
named "input.N" or a character string (in double quotes, spaces
permitted) denoting the external file name. For a string, it may
either be a full path name with directory specified or a simple
filename. In the later case, the file is sought first in the
current directory, then in SSDIR, and finally in SFDIR.
PerformanceSres -- output of the line read from
ifilname.
kline -- line number, or -1 when end of file has been reached.
This opcode allows a line of text to be read from a named
external file. There may be any number of
readf opcodes in an instrument or orchestra
but they read separately from the same or different files.
Examples
Here is an example of the readf opcode. It uses the file readf.csd.
Example of the readf opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.See alsoFile Input and OutputCredits&namejohn; and Joachim Heintz2012; new in 5.17.12