This skill should be used when working with Strudel.cc, a live-coding music environment. Use when creating musical patterns, drum sequences, melodies, basslines, or generative compositions. The user will always want to run Strudel code in the browser, either by copy-pasting or by providing a clickable URL with the code encoded in base64.
Strudel is a browser-based live-coding environment that ports TidalCycles' pattern language to JavaScript. It uses pure functional programming to create musical patterns that can include drums, melodies, synthesis, and effects. Patterns are immutable query functions that transform time spans into event streams, supporting mini-notation DSL, Euclidean rhythms, and extensive audio processing.
Use this skill when:
When a user requests a pattern, clarify:
For genre/artist-specific techniques, consult references/genre-styles.md which provides:
Build patterns using Strudel's functional, compositional approach:
Basic structure:
// Simple drum pattern
s("bd hh sd hh")
// With tempo
s("bd hh sd hh").cpm(120)
// Layered with stack
stack(
s("bd(3,8)"), // Kick drum
s("hh*8"), // Hi-hats
s("~ sd ~ sd") // Snare on backbeat
).cpm(120)
Key patterns:
"bd hh sd") for concise rhythm specificationstack() to layer multiple patterns.cpm() for tempo in cycles per minute(pulses, steps) for interesting distributions.off(1/8, x => x.add(7))The user always wants to run the code in their browser. Provide both:
scripts/strudel_url.py for immediate playbackWhen to encode URLs:
Encoding a URL:
python3 scripts/strudel_url.py encode 's("bd hh sd hh").cpm(120)'
This produces a clickable link like: