compilestr

compilestr — compiles a new orchestra passed in as an ASCII string

Description

Compilestr 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. Only new instances will use the new definition. Multi-line strings are accepted, using {{ }} to enclose the string.

Syntax

compilestr Sorch

Initialization

Sin -- a string (in double-quotes or enclosed by {{ }}) containing one or more instruments.

Examples

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

Example 122. Example of the compilestr opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
-o dac -d
</CsOptions>
<CsInstruments>

instr 1

i1 compilestr {{
instr 2 
a1 oscils p4, p5, 0
out a1 
endin 
}}
scoreline_i "i 2 0 1 10000 440"

turnoff
endin

</CsInstruments>
<CsScore>
i1 0 1

</CsScore>
</CsoundSynthesizer>


See also

event, event_i, schedule, schedwhen, schedkwhen, schedkwhennamed

Credits

Author: Victor Lazzarini, 2013