Compileorc will compile one or more instruments at init time, which will be added to the running engine. In case of existing instrument numbers or names, these will be replaced, but any instance still running of the old instrument definition will still perform until it terminates.
Syntax
ires=compileorc(Sfilename)
irescompileorcSfilename
Initialization
“Sfilename” -- a string containing the name of the file containing the orchestra.
ires -- returns 0 if compilation was successful, or -1 if not.
Examples
Here is an example of the compileorc opcode. It uses the file compileorc-modern.csd.
<CsoundSynthesizer><CsOptions>-o dac -d
</CsOptions><CsInstruments>sr=44100nchnls=1ksmps=320dbfs=1instr1res:i=compileorc("does_not_exist.orc")print(res); -1 as could not compileres=compileorc("my.orc")print(res); 0 as compiled successfullyevent_i("i",2,0,3,0.2,465);send event endin</CsInstruments><CsScore>i101</CsScore></CsoundSynthesizer>
Here is an example of the compileorc opcode. It uses the file compileorc.csd.
<CsoundSynthesizer><CsOptions>-o dac -d
</CsOptions><CsInstruments>sr=44100nchnls=1ksmps=320dbfs=1instr1irescompileorc"does_not_exist.orc"printires; -1 as could not compileirescompileorc"my.orc"printires; 0 as compiled successfullyevent_i"i",2,0,3,.2,465;send event endin</CsInstruments><CsScore>i101</CsScore></CsoundSynthesizer>