7.10.2. STRUDEL-02 — Mini-Notation Fundamentals

The mini-notation is a tiny string DSL for describing rhythmic patterns. A line like "bd sd ~ cp" reads almost like a drum-kit transcription and parses to a real Pattern. This tutorial covers the four primitives you will use in nearly every pattern you write: sequences, rests, subdivisions, and repeats.

7.10.2.1. Part A: Sequences and rests

The simplest mini-notation is a space-separated list of tokens. Each token gets an equal slice of the cycle:

let pat <- s("bd sd ~ cp")
play(pat, 4.0)

Four tokens, each occupies 1/4 of a cycle. The kick lands at 0/4, the snare at 1/4, silence at 2/4 (~ is the rest token), and the clap at 3/4. Replace ~ with another sound and the rhythm fills in.

This is the canonical four-on-the-floor skeleton you will see throughout the strudel ecosystem. s() does all the work — it tokenises the string, builds a parse-tree-free Pattern via recursive descent, and returns it.

7.10.2.2. Part B: Subdivisions with [ ]

Square brackets group tokens into a sub-sequence that fits inside one step of the parent sequence:

let pat <- s("bd [sd sd] ~ cp")
play(pat, 4.0)

Now slot two contains two snares packed together — the same total time that a single snare took before. This is recursive: [a [b c] d] works exactly as you expect, with b and c sharing the slot that b alone would have occupied.

Subdivision is the operation that gives mini-notation its expressive power. With nothing else, you can already write any rational rhythm.

7.10.2.3. Part C: Repeats with *N

The *N postfix is a shorthand for “repeat this token N times within its step”:

let pat <- s("bd hh*4 sd hh")
play(pat, 4.0)

hh*4 is exactly equivalent to [hh hh hh hh] — four hi-hats packed into the second slot. *N is read first, so hh*4*2 packs eight hats. There is also /N for the inverse (slow down by N), but for in-cycle repetition *N is the workhorse.

7.10.2.4. Part D: Combining the basics

All three primitives nest and combine freely:

let pat <- s("bd [sd sd*2] ~ hh*4")
play(pat, 4.0)

Reading left to right: kick, then a sub-sequence containing one snare and a doubled snare, then a rest, then four hats. This single string describes a busy backbeat — and it is still just data, just a Pattern, ready to be transformed by fast, rev, euclid, or any other combinator.

7.10.2.5. Where next

Tutorial 03 covers the four advanced mini-notation operators that the simple sequencer does not give you: angle brackets <a b c> for per-cycle alternation, @N for elongation, ? for random degrade, and !N for parent-level replication.

See also

Full source: tutorials/daStrudel/daStrudel_02_mini_notation_fundamentals.das

Previous tutorial: STRUDEL-01 — Hello Pattern

Next tutorial: STRUDEL-03 — Mini-Notation Advanced

Related: Strings — string interpolation behaves like mini-notation parsing