prints — Prints at init-time using a printf() style syntax.
"string" -- the text string to be printed. Can be up to 8192 characters and must be in double quotes.
kval1, kval2, ... (optional) -- The k-rate values to be printed. These are specified in “string” with the standard C value specifier (%f, %d, etc.) in the order given. Use 0 for those which are not used.
prints is similar to the printks opcode except it operates at init-time instead of k-rate. For more information about output formatting, please look at printks's documentation.
Here is an example of the prints opcode. It uses the file prints.csd.
Example 344. Example of the prints opcode.
See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
<CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform ; Audio out Audio in -odac -iadc ;;;RT audio I/O ; For Non-realtime ouput leave only the line below: ; -o prints.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> /* Written by Matt Ingalls, edited by Kevin Conder. */ ; Initialize the global variables. sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 ; Instrument #1. instr 1 ; Init-time print. prints "%2.3f\\t%!%!%!%!%!%!semicolons!\\n", 1234.56789 endin </CsInstruments> <CsScore> /* Written by Matt Ingalls, edited by Kevin Conder. */ ; Play instrument #1. i 1 0 0.004 </CsScore> </CsoundSynthesizer>
Its output should include a line like this:
1234.568 ;;;;;;semicolons!