Mini-Notation Grammar
This is the terse lookup table for everything that goes inside pattern brackets. For the narrative walkthrough with timing breakdowns, see Mini-Notation in Depth; for euclidean and polymetric rhythms in depth, see Polymetric & Euclidean.
Every example below is a fragment — drop it inside a pattern and feed it to a track:
use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.load_instrument(Sampler(Kit("TR-808")));
drums << [bd <sd [sd sd]>, ch*8, <_ oh>];
PLAY;Structure
Section titled “Structure”How elements are grouped and how time is divided.
| Token | Name | Meaning |
|---|---|---|
[ … ] | Sequence | Elements share the slot, each gets slot / count. Nest to subdivide. |
, | Parallel groups | Split a bracket into simultaneous voices, each on its own time grid. |
< … > | Alternation | One element per cycle, chosen by cycle % count; fills the whole slot. |
{ … } | Polymetric | Steps per cycle = length of the first group (or 1 for a single group). |
{ … }%n | Polymetric ÷ n | Force n steps per cycle regardless of group length. |
_ | Rest | A silent slot. |
let sequence = [C4 D4 E4]; // three slots, 1/3 cycle eachlet nested = [[C4 D4] E4]; // C4,D4 in the first half; E4 in the secondlet parallel = [C4 D4, E4 F4 G4]; // two voices, 2-against-3let alt = <C4 D4 E4>; // C4, then D4, then E4 — one per cyclelet poly = {C4 D4 C4 E4}%3; // three steps per cycle, phasing over fourlet with_rest = [C4 _ E4 _]; // notes on slots 1 and 3Modifiers
Section titled “Modifiers”Postfix timing shorthand on a single element. At most one per element.
| Token | Name | Effect | Example | Equivalent |
|---|---|---|---|---|
*n | Fast | Play n times within the slot (speeds up) | bd*2 | [bd bd] |
/n | Slow | Stretch the element over n cycles in the slot | [C4 D4]/2 | spans 2 cycles |
@n | Weight | Take an n× share of the cycle (plays once, longer) | bd@2 sd | bd 2/3, sd 1/3 |
!n | Replicate | Expand into n separate slots at normal speed | bd!3 | bd bd bd |
let fast = [bd sd*2]; // sd plays twice inside its halflet slow = [<C4 D4>/2 E4]; // the alternation advances every 2 cycleslet weighted = [C4@3 D4]; // long C4, quick D4let replicate = [bd!4]; // same as [bd bd bd bd]*n, /n, and @n accept decimals (*1.5, @2.5); !n takes integers only.
Decorations
Section titled “Decorations”Postfixes that shape what an element plays. These combine with each other and with a modifier.
| Token | Name | Meaning |
|---|---|---|
^v | Velocity | Strike velocity 0–127, e.g. C4^120. |
(k,n) | Euclidean | k pulses spread over n steps. |
(k,n,r) | Euclidean + rot | As above, rotated by r steps. |
Root:Quality | Chord | A chord, e.g. C4:maj7; add ~i for inversion i (C4:maj7~1). |
^N | Scale degree | Degree N of the current scale/key (see Music Theory). |
^N:Quality | Degree chord | A chord built on scale degree N. |
.method(…) | Sample method | Transform a sample hit; chains, e.g. bd.vel(1.2).pan(0.5). |
let accented = [C4^120 C4^60 C4^60 C4^60]; // accent on beat 1let euclid = [bd(3,8) sd(5,8,2)]; // euclidean kick + rotated snarelet chords = [D4:min7 G4:7 C4:maj7~1]; // ii–V–I, last chord invertedlet degrees = [^1 ^3 ^5 ^3]; // arpeggio over the current scalelet shaped = [bd.vel(1.2) sd.pitch(-5).pan(0.5)];Combining Order
Section titled “Combining Order”When several postfixes attach to one element they appear in a fixed order:
element velocity euclid modifier C4 ^80 (3,8) *2So C4^80(3,8)*2 is valid; reordering the postfixes is not.
Element Types
Section titled “Element Types”What can sit in a slot:
| Kind | Examples | Notes |
|---|---|---|
| Note | C4, F#3, Bb-1, G9 | Scientific pitch; octaves -1–9 (C4 = MIDI 60). |
| Number | 60, -5, 0.5 | Raw values for numeric patterns and automation. |
| Sample | bd, sd, hh | Kit sample names; accept .method(…) postfixes. |
| Chord | C4:maj, A3:min7 | See the chord qualities table. |
| Scale degree | ^1, ^-3, ^5:min | Resolved against the active scale/key. |
| Rest | _ | Silence for one slot. |
See Also
Section titled “See Also”- Mini-Notation in Depth — the same syntax, explained step by step
- Polymetric & Euclidean — phasing meters and euclidean rhythms
- Transforming Patterns — the pattern method API (
.fast(),.slow(),.reverse(), …) - Music Theory — chord qualities, scales, and scale degrees