Reference

Mini notation

Compact temporal notation inside strings, embedded in Common Lisp.

Mini notation is compact temporal notation written inside strings. It is embedded in Common Lisp rather than replacing it: a string such as "bd [hh hh] sn hh" is an argument to a pattern literal, and the code around it stays ordinary Lisp.

Notation

NotationMeaningExample
SpacesSequence within the current cycle or group."bd hh sn hh"
~Rest."bd ~ sn ~"
[ ... ]Subdivide the containing slot."bd [hh hh] sn hh"
Comma inside a groupParallel voices."[bd ~ sn ~, hh*8]"
< ... >Alternate across cycles."<bd sn sn>"
Nested < ... >Nested cycle alternation."<<bd cp> [sn hh] <hh hh cp>>"
*Repetition/faster local occurrence."hh*8"
/Span more cycles."<bd sn>/2"
@Relative temporal weighting."bd@3 hh sn@2 hh"
_Extend the preceding event’s whole rather than make a new attack."f3 _ ab3 c4"
:N after a soundSample variant, not pitch."hh:0 hh:1 hh:2 hh:3"
Numeric rangeA range of numeric values."0..7"
Euclidean suffixA Euclidean attack structure."bd(3,8)"

Two entries are easy to misread:

  • _ lengthens the preceding event’s whole span. It does not add an attack. The difference between an event’s whole span and the part a query sees is explained in Patterns and time.
  • :N after a sound selects a sample variant. It does not change pitch; absolute pitches belong to notes, described in Pitch, harmony, and tuning.

Complete examples

The following are complete musical examples. They use the bd, sn, hh and cp SuperDirt banks; see what sound-bearing examples need.

Common Lisp
(d1! (s "bd [hh hh] sn [hh hh hh]"))

(d1! (s "<<bd cp> [sn hh] <hh hh cp>>"))

(d1! (s "hh*<2 4 8 16>"))

(d1! (e 3 8 bd))
  • The first subdivides two slots with brackets, into two and then three hh events.
  • The second nests alternations inside an alternation, with a bracket group among the choices.
  • The third combines * with a < ... > alternation.
  • The fourth uses the e literal for compact Euclidean construction. Inside a string, the Euclidean suffix (as in "bd(3,8)") describes a Euclidean attack structure.

Nested groups are structural

Nested groups are structural, not a requirement to hand-count a fixed number of notes. A group describes how a slot is divided, however many tokens it holds.

The distinction becomes particularly useful for part and stem slice notation. Slice strings are ordinary mini notation; they are not required to contain eight tokens merely because the default source division has eight slices. A part slice string is timed in ordinary Mora cycles by default, while a stem :p string is timed by default in source slices of the selected recording (see slice timing). Nested alternations and rests in a slice string do not retune the sample. See Stems and sample libraries.

Source references

Repository-relative paths in the Mora source where these mechanisms are implemented.

  • src/mini/notation/

Documentation

Search the documentation

Results update as you type. Use the up and down arrow keys to choose a result and Enter to open it.