home/ atoms/ strudel-dollar-parallel

The $: prefix declares an independent pattern that plays simultaneously with other $: patterns

Prefixing a pattern expression with $: declares it as an independent pattern block. Without $:, only one pattern plays per evaluation block; with $:, any number of $:-prefixed patterns in the same code cell run in parallel, each on its own timeline. Every $: block is a full, independently editable pattern that can carry its own sounds, effects chain, and transformations. This is the standard Strudel idiom for layering drums, bass, chords, and melody as separate lines — the alternative to nesting everything inside a single stack() call, and the basis for building up a live-coded arrangement one line at a time.

Examples

$: sound(“bd sd”) $: note(“c e g”).sound(“piano”) $: sound(“hh*4”)

// each line is its own track, editable and re-evaluable independently

Assessment

Write a Strudel sketch with three simultaneous layers (drums, bass, melody), each on its own $: line. Then mute one layer by deleting its line and re-evaluating, and explain how $: differs from wrapping the same patterns in stack().

“we’re using `$:` before each `sound` - this lets us play multiple sounds within the same block of code”
corpus · music-code-strudel-worksheet-lucy-cheesman-peckham-digital · chunk 1
“If you want to play multiple patterns at the same time, make sure to write `$:` before each”