Skip to main content

Sequence Modifiers

Colon-chained modifiers reshape pattern and sequence references at expansion time over a flat token array (notes, rests, sustains, inline-effect tokens).

seq a = lead:rot(1):pal:transpose(+2)
seq b = motif:every(2,oct(+1)):lag(1)
seq c = riff:shuffle(42)

Modifiers apply left-to-right. Transpose family (oct, +N, semitone, …) accumulates and applies once at the end of the chain. Unknown modifiers warn and are ignored.

For a narrative walkthrough with the Tutorial Groove, see Tutorial — Modifiers.

Modifier catalog​

ModifierAliasesBehaviour
oct(N)—Octave transpose (N × 12 semitones)
+N / -Nsemitone(N), st(N), trans(N), transpose(N)Semitone transpose
rot(N)rotate(N)Cyclic left rotation by N tokens
rev—Reverse token order
palpalindromePalindrome: tokens + reverse without duplicating pivot
slow(N)slow (default 2)Repeat each token N times
fast(N)fast (default 2)Keep every Nth token
arp(a,b,…)—Merge inline arp: on each note (omit leading 0)
clamp(MIN,MAX)—Clamp pitch to range
fold(MIN,MAX)—Fold pitch into range by octaves
muterestReplace notes with ., keep rhythm
inst(name)—Sequence-level instrument override
pan(value)—Pan override for the segment
invertinvInvert pitch contour around the first note
every(N,MOD)—Apply inner modifier on positions N, 2N, … (1-based)
off(N)lag(N)Prepend N rest tokens
pick(i,j,…)—Keep listed 1-based token positions
chunk(N)—Split into chunks of N, reverse each chunk
shuffle(seed)—Deterministic seeded shuffle
presetNameany defined effectApply named effect preset to all notes

Constraints​

  • every(N,MOD) must stay token-local: the inner modifier must produce exactly one token and must not introduce inst or pan overrides. Otherwise the token is left unchanged with a warning.
  • Nested parentheses in modifier arguments support one level (e.g. every(2,oct(+1))).
  • shuffle requires an explicit seed for deterministic export.

Details with demos​

Rotate (rot)​

Cyclic left shift by N tokens.

rot(2)

Interactive playback loads in the browser.

…
seq a = motif # original phrase
seq b = motif:rot(2) # rotate left by 2 tokens
…

Reverse and palindrome​

rev and pal

Interactive playback loads in the browser.

…
seq a = motif # original phrase
seq b = motif:rev # reverse token order
seq c = motif:pal # palindrome (forward + reverse, no duplicated pivot)
…

Octave and transpose​

oct(+1) and transpose(+2)

Interactive playback loads in the browser.

…
seq a = motif # original phrase
seq b = motif:oct(+1) # up one octave
seq c = motif:transpose(+2) # up two semitones
…

Slow and fast​

slow repeats tokens (lengthens); fast keeps every Nth token (shortens). Prefer length-preserving modifiers when locking multiple channels.

slow(2) and fast(2)

Interactive playback loads in the browser.

…
seq a = short # original (4 tokens)
seq b = short:slow(2) # repeat each token twice (lengthens)
seq c = short:fast(2) # keep every 2nd token (shortens)
…

Every​

Apply an inner modifier on every Nth token (1-based).

every(2,oct(+1))

Interactive playback loads in the browser.

…
seq a = motif # original phrase
seq b = motif:every(2,oct(+1)) # every 2nd token up an octave
…

Lag / off​

Prepend rest tokens.

lag(2)

Interactive playback loads in the browser.

…
seq a = motif # original phrase
seq b = motif:lag(2) # prepend 2 rests (delay the phrase)
…

Shuffle​

Deterministic reorder with an explicit seed.

shuffle(42)

Interactive playback loads in the browser.

…
seq a = motif # original phrase
seq b = motif:shuffle(42) # deterministic shuffle (seed 42)
…

Named effect as modifier​

Any defined effect preset can be applied as a modifier (e.g. :stacc for effect stacc = cut:2).

Named effect modifier

Interactive playback loads in the browser.

…
effect stacc = cut:2 # named preset: gate each note after 2 ticks
pat motif = C5 E5 G5 C6 E5 G5 A5 G5
seq a = motif # plain notes
seq b = motif:stacc # apply the named effect as a modifier
…

See also​