prints

Name

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

Description

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

Syntax

prints "string" [, kval1] [, kval2] [...]

Initialization

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

Performance

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.

Examples

Here is an example of the prints opcode. It uses the files prints.orc and prints.sco.

Example 15-1. Example of the prints opcode.

/* prints.orc */
/* 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
/* prints.orc */
        
/* prints.sco */
/* Written by Matt Ingalls, edited by Kevin Conder. */
; Play instrument #1.
i 1 0 0.004
/* prints.sco */
        
Its output should include a line like this:
1234.568        ;;;;;;semicolons!
      

See Also

printks

Credits

Author: Matt Ingalls
January 2003