Embed one RTcmix scorefile within another.
include filename
include allows you to “include” an external file in another scorefile. The “included” file will behave as if the text of the file were part of the original scorefile; i.e. all variable assignments, table-creation or option-setting done in the “included” portion will have affect throughout the rest of the ‘parent’ scorefile. In other words, the “included” file will behave as if it were typed into the “parent” scorefile at the point where the include directive is placed.
The syntax is easy, although it differs slightly from the standard Minc or other parser-interface syntax:
include otherfile.sco
where otherfile.sco can be an absolute or relative path to a scorefile or scorefile fragment to be included. An include statement may be placed anywhere in the ‘parent’ scorefile. “included” scorefiles may also contain include statements, up to a nesting depth of 10.
This command makes it convenient to collect a set of values or parameters in a single file that can then be included in multiple scorefiles.
The include statement has to start in column 1.
This is similar to the #include directive in C/C++.
dice = random()
if (dice > 0.5) {
include firstbigchunk.sco
} else {
include secondbigchunk.sco
}
The above scorefile will be altered by the inclusion of firstbigchunk.sco or secondbigchunk.sco depending on the random value of dice. Note that the include directive is placed in column 1, not indented.