sprintfStrings:Manipulationsprintfsprintf
printf-style formatted output to a string variable.
Descriptionsprintf write printf-style formatted output to a string variable, similarly to the C function sprintf(). sprintf runs at i-time only.
SyntaxSdst sprintf Sfmt, xarg1[, xarg2[, ... ]]InitializationSfmt -- format string, has the same format as in printf() and other similar C functions, except length modifiers (l, ll, h, etc.) are not supported. The following conversion specifiers are allowed:
d, i, o, u, x, X, e, E, f, F, g, G, c, sxarg1, xarg2, ... -- input arguments (max. 30) for format, should be i-rate for all conversion specifiers except %s, which requires a string argument. Integer formats like %d round the input values to the nearest integer.
PerformanceSdst -- output string variable
Examples
Here is an example of the sprintf opcode. It uses the file sprintf.csd.
Example of the sprintf opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
Its output should include lines like this:
The file name is: 'impuls20.aiff'
soundin: opened 'impuls20.aiff'
See AlsoString Manipulation OpcodesCreditsAuthor: Istvan Varga2005