Notes Mode

BoxyLady user manual

Notes mode is entered by seq(@SLOT type(FORMAT) channels=CHANNELS music=MUSIC), and is also of revelance when creating defintions with def. Here, SLOT is the new slot to be created, 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 [].

Contexts

Before going further into notes mode, it is necessary to describe music contexts, which are the stacked sets of parameters describing the current state of the notes interpreter, in terms of time point, volume, chosen instrument, and so on. A new context is created each time a block of musical notation is surrounded by the delimeters <> or []. Each context inherits from its parent context the current state of the parser. See the following pseudocode where a b c etc. are notes and AAA BBB etc. are commands that alter the state.

[b AAA c d <BBB e f CCC g a>]

Here, at b, the new context inherits from the state defined by global. All notes produced after AAA are affected by that, but only within this block defined by []. The command BBB only applies within the angled brackets, and the command CCC only applies within the angled brackets from the point at which it is issued.

Definitions created with def do not automatically create a new context and it is as if they were typed directly into the context from which they are included (with \SLOT). However, delimeters can be used within definitions to create new nested contexts there. Definitions do not themselves produce audio data in their slot, only in the slot from which they are called.

A key property of contexts are their time pointer and length pointers. These behave differently within [] and <> contexts.

In [] contexts, each note (or nested context) advances the time pointer by its length, and the length pointer by the same, forming a tune.

Thus, in the example above, the duration of the whole context is 4 beats long.

In <> contexts, the time pointer is not advanced by each note, but the length pointer is updated so as to be the maximum length of any note (or context) nested within it. This can be used to form chords or polyphony. The following pseudocodes show alternate ways to form a three-beat tune with two voices.

[<c f> <d g> <c f>]
<[c d c] [f g f]>

Notation for musical notes

The following page explains how to put musical notes together to form a tune. This following section explains the basics of musical notation in the program. This has a lot in common with GNU Lilypond, but with important differences.

Pitch

Musical notes are generated (using the currently selected instrument, see later) by a b c d e f g. Sharps, flats, and double sharps and flats are generated with as gis ges gisis geses.
Half sharps and flats can also be produced: from double flat to double sharp (on G) in half step intervals, use geses geseh ges geh g gih gis gisih gisis.

By default, the parser moves to a note "nearest" the previous note, ignoring any accidentals. Thus c f represents a fourth step up, whereas cis ges represents a doubly augmented fourth step down.
Apostrophe and comma marks can be added after a note to indicate octave steps upwards and downwards. Thus c c' c,, represents an octave step up, followed by two down.

Rests are generated with r which behaves otherwise like a note.

Duration

The duration of any subsequent notes is specified by a duration command. These are specified as an integer number indicating the denominator of a fraction of a semibreve. Thus 1 2 3 4 6 8 12 16 represent in order: semibreve, minim, triplet minim, crotchet (quarter note), triplet crotchets, quaver (eighth note), triplet quavers, semiquaver.
Dots can be added to length notes by half, three quarters, etc. e.g. 4. 8...
A hyphen after the number indicates that the notes should be allowed to reverberate after their specified duration: 4.-.

Longer or more awkward durations can be generated by D(NUM DENOM rev). This creates a note NUM/DENOM semibreves (quarter notes) long. rev is optional: if set, it specifies reverberation.

Articulation

Note values can be followed by a hyphen and then several symbols representing articulation. ces-. ces-\ represent staccato and short staccato. ces-^ ces-- represent a strong and mild accent. These two pairs of articulations can be used in combination, e.g. ces--..