Modes of operation

BoxyLady user manual

On first parsing a script file, BoxyLady begins in an outer sample mode. Sample mode allows loading and saving of samples, libraries, and management of the program. Commands exist that move the program into other modes, namely global mode, synth mode, and sequence mode.

Global mode is entered by global(COMMANDS). Global mode sets global default values used when parsing music expressions. As such, it uses the same commands as sequence mode, with the important exception that commands that cause music to be actually created may not be used (either silently ignored or error raised).

Synth mode is entered by synth(COMMANDS). In synth mode, sound generators can be applied to one or more samples.

Notes mode is entered by seq(@SLOT type(FORMAT) channels=CHANNELS music=MUSIC). Here, SLOT is the new slot to be created, which must be a currently unused slot name, FORMAT is a sample type (see earlier), CHANNELS should be 1 or 2 for mono or stereo, and MUSIC contains actual music data, delimeted by <> or []. COMMANDS contains music expressions as detailed later.

Definitions can be created for use within notes mode (and therefore count as notes mode themselves). These are defined as def(NAME1=(COMMANDS1) NAME2=(COMMANDS2) ...) where as many name–command pairs can be defined as required in one def() block. All names must be currently unassigned to a slot.

Libraries are loaded from sample mode by library("FILENAME"). The commands inside are evaluated in sample mode. ––library("FILENAME") is similar, although does not raise an error if the file is not found.

This section explains those commands available in outer (sample) mode that do not relate to processing of samples

Comments are given by rem("TEXT"). The whole of the remaining line is treated as a comment and skipped.

echo("TEXT") sends the rest of the line of input file to standard output as a comment.

end() terminates parsing of the current input file.

list() prints a summary list of the contents of all slots.

default:samplerate(FREQ) sets the default sample rate, relative to which sample rates sr hi HI instrument are calculated.

default:gate(BOOL) sets the default gating (for newly created samples) for the start and end of generated musical notes off (where BOOL is false) or on (where BOOL is true). If set, this avoids clicks at the ends of notes, but is not always required. This is a per-sample setting set when a sample is first generated.