Skip to content

Strudel Reference

This reference covers the core functions available when writing patterns in AlgoBooth. Functions are organized by category. Each entry includes the signature, a description, and a code example.


Sound Sources

s(pattern) / sound(pattern)

Plays a named sample. The argument is a mini-notation string of sample names.

s("bd hh sd hh")

note(pattern)

Plays a pitched sound. Accepts note names (c3, eb4, g#2) or MIDI numbers (48, 52).

note("c3 e3 g3 b3")
note("48 52 55 59")

n(pattern)

Selects which variant of a sample to play (zero-indexed), or a scale degree when used with .scale().

s("hh*4").n("0 1 2 3")
n("0 2 4 6").scale("C:minor").s("piano")

freq(pattern)

Sets pitch directly in Hz. Useful for microtonal work or non-standard tuning.

freq("220 275 330 440")

Effects

gain(n)

Sets volume. Range is 0 (silent) to 1 (full). Values above 1 amplify.

s("bd hh sd hh").gain(0.7)
s("hh*16").gain("[0.25 1]*4")

room(n)

Adds reverb. Values typically 0–2. Higher values create a larger, longer tail.

note("c3 e3 g3").s("sine").room(0.5)
note("c4 eb4 g4").s("gm_accordion").room(2)

delay(n)

Adds echo send. Value 0–1 controls the amount of signal sent to the delay.

s("bd rim").delay(0.5)
note("c3 e3").s("sawtooth").delay(0.4)

delaytime(n) / delayfeedback(n)

Controls delay time (in cycles) and feedback (repetition amount) independently.

s("bd sd").delay(0.5).delaytime(0.125).delayfeedback(0.5)

pan(n)

Stereo position. 0 = full left, 0.5 = center, 1 = full right.

s("bd hh sd hh").pan("0 0.3 0.6 1")
note("c3 e3 g3 b3").pan(sine.range(0, 1).slow(4))

lpf(hz)

Low-pass filter. Frequencies below the cutoff pass; above are attenuated. Lower values sound more muffled.

note("c2 g2 f2 e2").s("sawtooth").lpf(800)
s("bd hh sd hh").lpf(saw.range(200, 4000))

lpq(n)

Low-pass filter resonance (Q factor). Higher values create a sharper, more resonant peak at the cutoff.

note("c3 e3 g3").s("sawtooth").lpf(600).lpq(8)

hpf(hz)

High-pass filter. Frequencies above the cutoff pass; below are attenuated.

s("bd hh sd hh").hpf(200)
note("c3 e3 g3").s("sawtooth").hpf(400)

vowel(pattern)

Formant filter that shapes sound to mimic vowel sounds. Accepts a, e, i, o, u.

note("c3 g3 e3 f3").s("sawtooth").vowel("<a e i o>")

crush(n)

Bit-crushing effect. Lower values produce more digital distortion.

s("bd hh sd hh").crush(4)
note("c3 e3 g3").s("sawtooth").crush(8)

shape(n)

Waveshaping distortion. Values 0–1 with 0 being no effect.

note("c2 g2 f2").s("sawtooth").shape(0.5)

speed(n)

Sample playback speed. 1 = normal, 2 = double speed (pitch up), -1 = reversed.

s("bd rim").speed("<1 2 -1 -2>")
s("jazz*4").speed(rand.range(0.5, 2))

orbit(n)

Assigns the pattern to an audio bus (orbit). Separating patterns onto different orbits isolates their reverb and delay.

note("c3 e3 g3").s("sawtooth").room(0.8).orbit(2)
s("bd*4").orbit(1)

Pattern Combinators

stack(...patterns)

Plays multiple patterns simultaneously in the same cycle.

stack(
s("bd*4"),
s("~ cp ~ cp"),
note("c2 g2 f2 g2").s("sawtooth")
)

cat(...patterns)

Plays patterns one after another, each taking one full cycle.

cat(
s("bd hh sd hh"),
s("cp ~ cp ~")
)

seq(...patterns)

Sequences patterns, dividing the cycle equally among them.

seq(s("bd sd"), note("c3 e3"), s("hh*4"))

fastcat(...patterns)

Like cat() but compresses all patterns into one cycle.

fastcat(s("bd sd"), s("cp hh"), s("rim ~"))

slowcat(...patterns)

Like cat() but stretches patterns across multiple cycles.

slowcat(s("bd hh sd hh"), s("cp ~ cp ~"))

Time Modifiers

fast(n)

Speeds up a pattern by a factor. .fast(2) plays the pattern twice per cycle.

s("bd sd").fast(2)
note("c3 e3 g3 b3").fast(4)

slow(n)

Slows down a pattern by a factor. .slow(2) plays the pattern over 2 cycles.

note("<c3 e3 g3 b3>").slow(4)
s("bd hh sd hh cp ~ sd hh").slow(2)

rev()

Reverses the pattern.

note("c3 e3 g3 b3").rev()
s("bd hh sd hh").rev()

jux(fn)

Applies a function to the right stereo channel only, creating a stereo effect from a mono pattern.

note("c3 e3 g3").s("sawtooth").jux(rev)
s("bd hh sd hh").jux(fast(2))

every(n, fn)

Applies a function every n cycles.

s("bd hh sd hh").every(4, rev)
note("c3 e3 g3 b3").every(2, fast(2))

euclid(beats, steps)

Distributes beats events across steps slots using the Euclidean algorithm.

s("bd").euclid(3, 8)
s("sd").euclid(5, 16)

Value Modifiers

add(n)

Adds a value to each event in the pattern.

note("0 2 4 6").add("<0 1 2 3>")

sub(n)

Subtracts a value from each event.

note("60 64 67").sub(12)

mul(n)

Multiplies each event value.

note("1 2 3 4").mul(12)

Randomness

rand

A continuous random signal between 0 and 1. Use .range() to set bounds.

s("hh*16").gain(rand)
note("c3 e3 g3").s("sawtooth").lpf(rand.range(200, 2000))

choose(...values)

Picks one value from the list at random each cycle.

s(choose("bd", "sd", "cp", "hh"))
note(choose("c3", "e3", "g3", "b3")).s("sine")

wchoose(...weightedValues)

Picks one value at random with weighted probability.

s(wchoose(["bd", 3], ["sd", 1], ["cp", 1]))

shuffle(pattern)

Shuffles the order of events in a pattern each cycle.

s("bd hh sd cp").shuffle()
note("c3 e3 g3 b3").shuffle()

sometimes(fn)

Applies a function to events with 50% probability.

s("hh*8").sometimes(fast(2))
note("c3 e3 g3").sometimes(rev)

often(fn)

Applies a function roughly 75% of the time.

s("bd hh sd hh").often(gain(0.8))

rarely(fn)

Applies a function roughly 25% of the time.

note("c3 e3 g3 b3").rarely(add(note(12)))

degradeBy(probability)

Randomly removes events with the given probability (0–1).

s("hh*16").degradeBy(0.3)
note("c3 e3 g3").degradeBy(0.5)

Structure

struct(pattern)

Applies a rhythmic structure from a boolean pattern to another pattern. t (true) keeps an event, f (false) silences it.

note("c3 e3 g3 b3").struct("t f t f t t f t")

mask(pattern)

Masks out events using a 0/1 pattern (0 removes, 1 keeps).

s("bd hh sd hh").mask("1 0 1 0")

euclid(beats, steps, offset?)

Euclidean rhythm: distributes beats across steps slots, with optional offset rotation.

s("bd(3,8)")
s("bd(5,8,2)")
stack(s("bd(3,8)"), s("sd(2,8,3)"), s("hh(7,8)"))

ADSR Envelope

Shape the volume contour of synthesized sounds.

attack(n) / decay(n) / sustain(n) / release(n)

note("c3 e3 g3").s("sawtooth")
.attack(0.05)
.decay(0.1)
.sustain(0.5)
.release(0.3)

adsr(string)

Shorthand notation: "attack:decay:sustain:release".

note("c3 e3 g3").s("sawtooth").adsr(".05:.1:.5:.3")

Signals

Continuous signals can be used as parameter values for smooth automation.

SignalDescription
sineSine wave, 0–1
sawSawtooth wave, 0–1
squareSquare wave, 0 or 1
triTriangle wave, 0–1
randRandom noise, 0–1
perlinSmooth random (Perlin noise), 0–1

Use .range(min, max) to scale: sine.range(200, 2000). Use .slow(n) to set the period: sine.slow(4) takes 4 cycles per oscillation.

s("hh*16").gain(sine)
note("c3 e3 g3").s("sawtooth").lpf(sine.range(200, 2000).slow(4))