It is sometimes convenient to have the orchestra arranged in a number of files, for example with each instrument in a separate file. This style is supported by the #include facility which is part of the macro system. A line containing the text
where the character " can be replaced by any suitable character. For most uses the double quote symbol will probably be the most convenient. The file name can include a full path.This takes input from the named file until it ends, when input reverts to the previous input. There is currently a limit of 20 on the depth of included files and macros.
Another suggested use of #include would be to define a set of macros which are part of the composer's style.
An extreme form would be to have each instrument defines as a macro, with the instrument number as a parameter. Then an entire orchestra could be constructed from a number of #include statements followed by macro calls.
It must be stressed that these changes are at the textual level and so take no cognizance of any meaning.Here is an example of the include opcode. It uses the files include.orc, include.sco, and table1.inc.
Example 1. Example of the include opcode.
/* include.orc */
/* Written by Kevin Conder */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
; Instrument #1 - a basic oscillator.
instr 1
kamp = 10000
kcps = 440
ifn = 1
a1 oscil kamp, kcps, ifn
out a1
endin
/* include.orc */
/* table1.inc */
/* Written by Kevin Conder */
; Table #1, a sine wave.
f 1 0 16384 10 1
/* table1.inc */
/* include.sco */
/* Written by Kevin Conder */
; Include the file for Table #1.
#include "table1.inc"
; Play Instrument #1 for 2 seconds.
i 1 0 2
e
/* include.sco */