Skip to content

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.

Syntax

readscore Sin

Initialization

“Sin” -- a string (in double-quotes or enclosed by {{ }}) containing one or more score events.

Examples

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

Example of the readscore opcode.
<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

See also

Instrument Invocation

Credits

Author: Victor Lazzarini, 2013