printks2
Prints a new value every time a control variable changes using a printf() style syntax.
Syntax
Initialization
"string" -- the text string to be used as a format.
Performance
kval -- signal to be printed. The style of printing is specified in “string” with the standard C value specifier (%f, %d, etc.).
Print Output Formatting
All standard C language printf() control characters may be used. For example, if kval1 = 153.26789 then some common formatting options are:
- %f prints with full precision: 153.26789
- %5.2f prints: 153.26
- %d prints integers-only: 153
- %c treats kval1 as an ascii character code.
In addition to all the printf() codes, printks2 supports these useful character codes:
printks Code | Character Code |
---|---|
\\r, \\R, %r, or %R | return character (\r) |
\\n, \\N, %n, %N | newline character (\n) |
\\t, \\T, %t, or %T | tab character (\t) |
%! | semicolon character (;) This was needed because a “;” is interpreted as a comment. |
^ | escape character (0x1B) |
^ ^ | caret character (^) |
~ | ESC[ (escape+[ is the escape sequence for ANSI consoles) |
~~ | tilde (~) |
For more information about printf() formatting, consult any C language documentation.
Examples
Here is an example of the printks2 opcode. It uses the file printks2.csd.
See also
Credits
Author: John ffitch
Bath, UK
Mar 2014
New in Csound version 6.03