| New opcodes of DirectCsound 'foutk', 'fouti', 'fiopen', 'foutir', 'fin',
'fink' and 'fini' can do this task, if properly used, even without
recording a MIDI file. Maybe John Fitch will decide to port them in
standard version, one day (and I hope it):
MANUAL
------
fout, foutk, fouti, foutir, fiopen
fout "ifilename", iformat, aout1 [, aout2, aout3,.... ,aoutN]
foutk "ifilename", iformat, kout1 [, kout2, kout3,....,koutN]
fouti ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN]
foutir ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN]
ihandle fiopen "ifilename",imode
DESCRIPTION
fout, foutk, fouti and foutir output N audio, k or i-rate signals to a
specified file of N channels.
fiopen can be used to open a file in one of the specified modes.
INITIALIZATION
ifilename - a double-quote delimited string file name
iformat - a flag to choose output file format:
for fout and foutk only:
0 - 32-bit floating point samples without header (binary PCM
multichannel file)
1 - 16-bit integers without header (binary PCM multichannel file)
2 - 16-bit integers with .wav type header (Microsoft WAV mono or stereo
file)
for fouti and foutir only:
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 choosen 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.
imode - choose the mode of opening the file.
imode can be a value choosen among the following:
0 - open a text file for writing
1 - open a text file for reading
2 - open a binary file for writing
3 - open a binary file for reading
PERFORMANCE
aout1,... aoutN - signals to be written to the file.
kout1,...koutN - signals to be written to the file.
fout (file output) writes samples of audio signals to a file with any
number of channels. Channel number depends by the number of
aoutN variables (i.e. a mono signal with only an a-rate argument, a
stereo signal with two a-rate arguments etc.) Maximum number of
channels is fixed to 64.
More fout opcodes can be present in the same instrument, referring to
different files.
Notice that, differently by out, outs and outq, fout does not zeroes the
audio variable, so you must provide a zeroing after calling fout if
poliphony is used. You can use incr and clear opcodes for this task.
foutk operates in the same way of fout, but with k-rate signals. iformat
can be set only to 0 or 1.
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
following strings:
i num actiontime duration
before the values of iout1...ioutN arguments. Prefix is referring to
instrument number, action time and duration of current note.
The difference of 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 ) wheras in the case of 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 fiopen
opcode (see below). So fouti and foutir can be used to generate a Csound
score while playing a realtime session.
fiopen opens a file to be used by the foutX opcodes. It must be defined
externally by any instruments, in the header section.
It returns a number ihandle, which is univocally referring to the opened
file.
Notice that fout and foutk can use both a string containing a file
pathname or a handle-number generated by fiopen, wheras in the
case of fouti and foutir, the target file can be only specified by means
of a handle-number.
fin, fink, fini
fin "ifilename", iskipframes, iformat, ain1 [, ain2, ain3,.... ,ainN]
fink "ifilename", iskipframes, iformat, kin1 [, kin2, kin3,.... ,kinN]
fini "ifilename", iskipframes, iformat, in1 [, in2, in3,.... ,inN]
DESCRIPTION
read signals from a file (at a, k, and i-rate)
INITIALIZATION
ifilename - input file name (can be a string or a handle number
generated by fiopen)
iskipframes - number of frames to skip at the start (every frame
contains a sample of each channel)
iformat - a number specifying the input file format:
for fin and fink:
0 - 32 bit floating points without header
1 - 16 bit integers without header
for fini:
0 - floating points in text format (loop; see below)
1 - floating points in text format (no loop; see below)
2 - 32 bit floating points in binary format (no loop)
fin (file input) is the complement of fout: it reads a multi channel
file to generate audio rate signals. At present time no header is
supported for file format. The user must be sure that the number of
channel of the input file is the same of the number of ainX
arguments
fink is the same as fin, but operates at k-rate.
fini is the complement of fouti and foutir, it reads the values each
time the corresponding instrument note is activated.
When iformat is set to 0, if the end of file is reached the file pointer
is zeroed, restarting the scanning from the beginning.
When iformat is set to 1 or 2 no loop is enabled, so at the end of file
the corresponding variables will be filled with zeroes.
Paul Winkler wrote:
>
> Paul Barton-Davis wrote:
>
> > (dd if=/dev/midi00 bs=1 | tee /dev/midi01 | cat - my-midi-session) &
> > csound -M /dev/midi02
>
> (snip)
>
> > % mkfifo /tmp/csound-midi-fifo
> > % dd if=/dev/midi00 bs=1 | \
> > tee my-midi-session > /tmp/csound-midi-fifo &
> > % csound -M /tmp/csound-midi-fifo ...
>
> Paul, I haven't tried either of your tee tricks -- no time right now, I
> just moved and still haven't unpacked my midi controller -- but I
> followed the logic and it seems to me they _should_ work ... except that
> won't the midi file created contain no timing information?? It's just a
> dump of raw midi data, right? Or am I mistaken?
>
> --
>
> ---------------- paul winkler ------------------
> slinkP arts: music, sound, illustration, design, etc.
>
> zarmzarm@hotmail.com --or-- slinkp AT ulster DOT net
> http://members.tripod.com/~slinkP/
> ======================================================
--
Gabriel Maldonado
http://web.tiscalinet.it/G-Maldonado/home2.htm |