Press Start. While it plays, edit the code and press Update (Ctrl/⌘+Enter).
Controls · every slider() in the code
Tracks · tap a name to mute it
The tracks appear after the first start.
Samples · use them with s("name:0")
Quick guide
| NAME: … | Labels a track (like CHOP:, BASSLINE:). With _NAME: the track is muted. let name = … and $: work too |
| s("kick:0") | Synthesised drums: kick/bd, snare/sd, clap/cp, hats/hh, tr909_hh, oh, perc/tom (lt mt ht), rim, cb, noise. Or a sample bank: chop (built-in) or your own files. |
| note("a2@2 e2") | Notes or MIDI numbers. Timbre with .s() or .sound(): sine, square, sawtooth, triangle, supersaw, reese, pad, gm_* (approximated). "[a, b]" layers them. |
| .struct("x - - x") | Rhythm: x or t plays, - or ~ is a rest. |
| "a*4" "[a b]" "<a b>" | Repeat · group into one slot · alternate one element per cycle. |
| "a@3 b" "a _ b" | Stretch: a lasts 3 parts out of 4. |
| "t(3,8)" "a!3" "a, b" | Euclidean rhythm · repeat the element · stacked layers. |
| slider(3000, 400, 8000) | Slider in the Controls panel: value, minimum, maximum. Moving it changes the sound straight away and updates the number in the code. |
| .trans("[0, -12, 7]") | Transposes in semitones; with commas it builds chords or octaves. |
| .ply("<8 4>") | Repeats each event n times within itself (stutter). |
| .scrub("0.8") .begin .end | Start point in the sample (0–1); "0.8:1.5" adds the speed. .speed(-1) plays it backwards. |
| .note(36) | On a sample: 36 is the original pitch, each unit a semitone. |
| .clip(1) | Cuts each sound to the length of the event. |
| .attack .decay .sustain .release | Envelope. With .decay and no .sustain the sound dies away (pluck). |
| .gain .postgain | Volume before and after the effects. |
| .lpf .hpf .resonance .ftype | Filters in Hz; .ftype('ladder') at 24 dB. |
| .delay .room .rfade | Echo · reverb (0–1) · reverb tail length in seconds (maximum 10). |
| .pan .distort .fast .slow | Pan 0–1 · saturation · speed. "<1 2>".fast(2) works as a value too. |
| ._punchcard() | Shows the track as a punchcard (rows per note or sound). |
| setcpm(120/4) | Cycles per minute. stack(a, b) plays only the tracks listed. |
Strudel's gm_* sounds are soundfonts: here they're imitated with a synth. .o(), .orbit(), .color() and .slice() are accepted but change nothing, because all tracks share a single echo and a single reverb. On iPhone, turn off the silent switch if there's no sound.