ifilename -- the output file's name (in double-quotes).
iformat -- a flag to choose output file format (note: Csound versions older than 5.0 may only support formats 0 and 1):
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 without header (binary PCM multichannel file)
3 - u-law samples without header
4 - 16-bit integers without header
5 - 32-bit integers without header
6 - 32-bit floats without header
7 - 8-bit unsigned integers without header
8 - 24-bit integers without header
9 - 64-bit floats without header
Performance
kout1,...koutN -- control-rate signals to be written to the file. The expected range of the signals is determined by the selected sample format.
foutk operates in the same way as fout, but with k-rate signals. iformat can be set only in the range 0 to 9, or 0 to 1 with an old version of Csound.
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.
Examples
Here is an example of the foutk opcode. It uses the file foutk.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;realtime audio out-iadc ;;;uncomment -iadc if real audio input is needed too; For Non-realtime ouput leave only the line below:; -o foutk.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; by Stefano Cucchi - 2020; Sing in your microphone for 10''; Estimated pitch & amplitude are written on 2 files "amp" 6 "pitch"; After 10'' a sawtooth is played with these valuessr=44100ksmps=32nchnls=20dbfs=1instr1;use pitchiupdte=0.001ilo=6ihi=10idbthresh=10ifrqs=24iconf=10istrt=8asig1,asig2inch1,2koct,kamppitchasig1,iupdte,ilo,ihi,idbthresh,ifrqs,iconf,istrt; pitch & amplitude trackingkcps=cpsoct(koct)kamp=kamp*0.00002foutk"amp",6,kamp; write amplitude values on a file - 32-bit floats without headerfoutk"pitch",6,kcps; write pitch values on a file - 32-bit floats without headerendininstr2kampreadk"amp",6,p4; read amplitude values fro the filekcpsreadk"pitch",6,p4; read pitchvalues fro the filekcpsportkkcps,0.008asigoscilikamp,kcps*p5,1; use amplitude & pitch to play a sawtoothkdeclicklinseg0,0.2,1,p3-0.4,1,0.2,0outsasig*kdeclick,asig*kdeclickendin</CsInstruments><CsScore>f10163841010.50.30.250.20.1670.140.125.111;sawtoothi1010i210100.0011;e</CsScore></CsoundSynthesizer>
To avoid zipper noise, by discontinuities produced from complex envelope tracking, a lowpass filter could be used, to smooth the estimated envelope.