readscore — Read, preprocess and schedule a score from an input string.
Readscore will issue one or more score events. It can handle strings in the same conditions as the standard score, including preprocessing (carry, sort, ramp, etc). Multi-line strings are accepted, using {{ }} to enclose the string.
“Sin” -- a string (in double-quotes or enclosed by {{ }}) containing one or more score events.
Here is an example of the readscore opcode. Play readscore.csd
Example 890. Example of the readscore opcode.
See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
<CsoundSynthesizer> <CsOptions> -d -o dac </CsOptions> <CsInstruments> instr 1 a1 flooper2 1000,p4,2,5,0.1,1 out a1 endin instr 2 ires readscore {{ {12 COUNT i1 $COUNT 1 [1 + $COUNT/12] } }} endin </CsInstruments> <CsScore> f0 12 f 1 0 0 1 "fox.wav" 0 0 1 i2 0 1 </CsScore> </CsoundSynthesizer>
You can use string opcodes like sprintfk to produce strings to be passed to readscore like this:
Sfil = "/Volumes/Bla/file.aif" String sprintfk {{i 2 0 %f "%s" %f %f %f %f}}, idur, Sfil, p5, p6, knorm, iskip readscore String