Strudel

Sun, 22 Nov 2026 10:27:16 GMT —

 Properties

Key Value
Identifier strudel
Name Strudel
Type Topic
Creation timestamp Sun, 22 Nov 2026 10:27:16 GMT
Modification timestamp Sun, 22 Nov 2026 11:31:00 GMT

Strudel is a live coding platform to write dynamic music pieces in the browser.

Core Ideas

  • Cycles: time is measured in cycles, not beats. Patterns repeat each cycle, and you set the tempo with setcps(...) (cycles per second). There is also a setcpm variant.
  • Mini-notation: a string syntax inspired by Tidal:
    • "bd sd [~ bd] sd": a sequence. ~ is a rest and [ ] subdivides a step.
    • "<c e g>": plays one item per cycle, taking turns.
    • *, /, !, @, ?: speed up, slow down, replicate, elongate, randomly drop.
    • ,: plays layers at the same time, as in "[c,e,g]".
    • "bd(3,8)": Euclidean rhythms.
  • Functions: you chain them in JS style, for example s(...), sound(...), note(...), n(...), .bank(...), .scale(...), .fast(), .slow(), .rev(), .jux(rev), .off(...), stack(...), cat(...), seq(...).
  • Effects: .lpf(), .hpf(), .room(), .delay(), .gain(), .pan(), .speed(), .crush() and so on.
  • Visuals: .pianoroll() and .punchcard(), plus inline highlighting of the pattern as it plays.
  • Multiple patterns: recent versions let you write $: lines to run several patterns at once, instead of wrapping everything in one stack(...).

Patterns and Cycles

  • A cycle is 2 seconds by default. Strudel's default tempo is 0.5 cycles per second, which gives 2 seconds per cycle. You change it with setcps(...), so setcps(1) makes each cycle 1 second.
  • Steps divide the cycle; they don't add time. This is the key idea. The cycle stays the same length, and each step gets an equal share of it:
  • Adding steps makes them faster, not the pattern longer (in time). Brackets apply the same rule inside a step: in "bd [sd sd] bd bd", the two sd hits share one quarter of the cycle.
  • A pattern is more than a sequence of sounds. In Strudel (as in Tidal), a pattern is a description of events over time. You give it a time span and it tells you which events happen in that span. In practice this means:
    • Patterns can hold any values, not only sounds. Notes, numbers and effect settings can all be patterns: note("c e g"), or .lpf("200 2000"), which changes the filter cutoff halfway through each cycle.
    • Patterns can span several cycles. "<bd sd>" plays bd in cycle 1 and sd in cycle 2, then repeats. .slow(2) stretches a pattern over two cycles.
    • The quoted string is just one way to write a pattern. It's called mini-notation. Functions such as seq(...), cat(...) and stack(...) build patterns too.

So a better mental model is: the cycle is the fixed unit of time, and a pattern describes what happens in each cycle, from one cycle to the next.

Pattern  Steps  Each step lasts (at 2s per cycle)
"bd"  1  2s
"bd bd"  2  1s
"bd bd bd bd"  4  0.5s
"bd bd bd bd bd bd bd bd"  8  0.25s

Back to top


Notes
Sun, 22 Nov 2026 11:07:23 GMT
Pattern vs. cycle

When you say "Adding steps makes them faster, not the pattern longer"... it does make the pattern longer... but, the pattern is played in the same amount of time (i.e., the cycle) effectively making the pattern as a whole play faster.

Yes, that's a better way to say it. My wording was unclear because "longer" can mean two things:

  • Longer in content (more steps): yes. "bd bd bd bd bd bd bd bd" has more events than "bd bd bd bd".
  • Longer in time: no. Both patterns still take exactly one cycle (2 seconds by default).

So the length of the pattern grows, but the time it has to play in stays fixed. Each event gets a smaller share of the cycle, so the events come faster. That is exactly what you described.

It also explains why .fast(2) and doubling the steps sound the same: s("bd bd").fast(2) and s("bd bd bd bd") both fit four hits into one cycle.


Sun, 22 Nov 2026 11:43:38 GMT
Understanding cycles

The difference between these two: s("bd hh") and s("<bd hh>") is that the first one will play the full pattern over two seconds... on 0.0 it plays "bd" and on 1.0 it plays "hh". The second pattern plays "bd" on 0.0 followed by "hh" on 2.0?

Yes, that's right. At the default 2 seconds per cycle:

s("bd hh"): both sounds share each cycle.

  • 0.0 s: bd
  • 1.0 s: hh
  • 2.0 s: bd (the next cycle starts)
  • 3.0 s: hh
  • and so on

s("<bd hh>"): one sound per cycle, taking turns.

  • 0.0 s: bd (cycle 1)
  • 2.0 s: hh (cycle 2)
  • 4.0 s: bd (cycle 3)
  • 6.0 s: hh (cycle 4)
  • and so on

In the first pattern, the whole sequence repeats every 2 seconds. In the second, each sound gets a full cycle, so it takes two cycles (4 seconds) for the sequence to come back to the start.

For this simple case, s("<bd hh>") sounds the same as s("bd hh").slow(2). The difference shows when there is more than one step. In s("<bd hh> sd"), the sd plays in every cycle, and only the first step alternates between bd and hh.


Back to top