prints
Prev | Orchestra Opcodes and Operators | Next

## prints

prints — Prints at init-time using a printf() style syntax.

## Description

Prints at init-time using a printf() style syntax.

## Syntax

    prints "string" [, xval1] [, xval2] [...]

## Initialization

"string" -- the text string to be printed. Can be up to 8192 characters and must be in double quotes.

## Performance

xval1, xval2, ... (optional) -- The k-rate values or strings to be printed. These are specified in “string” with the standard C value specifier (%f, %d, %s etc.) in the order given.

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.

## Examples

Here is an example of the prints opcode. It uses the file prints.csd.

Example 759. 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!

## See Also

printks

## Credits

Author: Matt Ingalls
January 2003

Prev | Up | Next
println | Home | printsk