Quick Start
Creme is a browser-based live coding music environment. No installation required - just start typing code and making music!
Basic Controls
- Play/Stop - Click the green button or press the button
- Ctrl+Enter - Re-evaluate code while playing
- Ctrl+/ - Comment/uncomment line
Your First Pattern
note("c3 e3 g3 c4").s("sine").slow(2)
Your First Sounds
Simple Melody
note("c3 e3 g3 c4")
.s("sine")
.slow(2)
Drum Beat with TR909
s("bd*4").bank("RolandTR909").gain(1)
Layered Pattern
stack(
s("bd*4").gain(0.9),
s("[~ sd]*2").gain(0.7),
s("hh*8").gain(0.3)
).bank("RolandTR909")
Named Patterns (Comment to Mute)
Use d1() through d16() for patterns you can mute by commenting out single lines. Also available: bass(), drums(), melody(), pad(), lead(), arp(), fx(), perc(), kick(), snare(), hats(), clap().
d1(s("bd*4").bank("RolandTR909").gain(1))
d2(s("[~ cp]*2").bank("RolandTR909").gain(0.7))
d3(s("hh*8").bank("RolandTR909").gain(0.4))
d4(note("c2 c2 g2 f2").s("bass").n(0))
Important: Keep patterns on single lines so // comments mute the whole pattern.
Control Functions
hush() - Stop all patterns
mute("d1") - Mute specific pattern
unmute("d1") - Unmute specific pattern
solo("d2") - Solo specific pattern
unsolo("d2") - Unsolo specific pattern
unsoloAll() - Unsolo all patterns
Pattern Creation
note(pattern)
Create a pattern of musical notes.
note("c3 e3 g3")
note("c3 ~ e3 ~")
note("[c3,e3,g3]")
s(sound)
Set the sound/sample for a pattern.
s("bd")
s("sine")
note("c3").s("saw")
mini(pattern)
Parse mini-notation string into a pattern.
mini("0 1 2 3")
mini("<0 1 2>")
mini("[0,2,4]")
Mini-Notation (Pattern Syntax)
Mini-notation is the pattern language used inside strings like s("bd*4") or note("c3 e3 g3"). It controls timing, rhythm, and structure.
Basic Timing
| Syntax | Meaning | Example |
a b c d | Space = divide cycle equally | s("bd sd bd sd") → 4 hits per cycle |
a*n | Repeat n times | s("bd*4") → 4 kicks per cycle |
a/n | Slow down by n | s("bd/2") → 1 kick every 2 cycles |
~ | Rest (silence) | s("bd ~ sd ~") → kick, rest, snare, rest |
Grouping & Subdivision
| Syntax | Meaning | Example |
[a b] | Group into single step | s("bd [hh hh] sd hh") → hh plays twice as fast |
[a b c]*2 | Group and repeat | s("[bd sd]*2") → bd sd bd sd |
[a,b,c] | Play simultaneously (chord) | note("[c3,e3,g3]") → C major chord |
Alternation
| Syntax | Meaning | Example |
<a b c> | Alternate each cycle | s("bd <sd cp>") → bd+sd, then bd+cp |
Sample Selection
| Syntax | Meaning | Example |
sample:n | Select sample index | s("808:0 808:3 808:5") → different 808 sounds |
Practical Examples
s("bd*4")
s("~ hh").fast(4)
s("~ sd").fast(2)
d1(s("bd*4"))
d2(s("~ cp").fast(2))
d3(s("hh*8"))
s("bd [~ bd] sd [bd ~]")
s("808:<0 3 5 7>")
note("[c3,e3,g3] [f3,a3,c4] [g3,b3,d4] [c3,e3,g3]").s("pad")
Pattern Combinators
stack(...patterns)
Layer multiple patterns simultaneously.
stack(
s("bd*4"),
s("hh*8").gain(0.5)
)
sequence(...patterns)
Play patterns in sequence.
alternate(...patterns)
Cycle through patterns each cycle.
Pattern Constructors
Functions that create new patterns from values.
| Function | Description | Example |
pure(value) | Single repeating value per cycle | pure(60).note() |
silence() | Empty/silent pattern | silence() |
once(pattern) | Play once then silence | once(s("rave")) |
replicate(n, pat) | Repeat n times per cycle | replicate(4, s("bd")) |
euclid(n, k, value) | Euclidean rhythm | euclid(3, 8, "bd") |
weighted([vals], [weights]) | Custom time divisions | weighted(["bd","sd"], [3, 1]) |
choosePattern(...pats) | Random pattern choice | choosePattern(s("bd"), s("sd")) |
Euclidean Rhythms
Distribute n events across k steps evenly. Classic technique for creating interesting rhythms.
euclid(3, 8, "bd").s()
euclid(5, 8, "hh").s()
stack(
euclid(3, 8, "bd").s(),
euclid(5, 8, "hh").s().gain(0.5)
)
Weighted Patterns
Create patterns with custom time divisions.
weighted(["bd", "sd"], [3, 1]).s()
Timing & Speed
.fast(n)
Speed up pattern by factor n.
s("bd").fast(4)
.slow(n)
Slow down pattern by factor n.
note("c3 e3").slow(2)
.cpm(tempo)
Set cycles per minute.
s("bd*4").cpm(120)
Probability & Randomness
| Method | Probability | Example |
.sometimes(p, fn) | Custom (0-1) | s("bd*4").sometimes(0.5, p => p.fast(2)) |
.often(fn) | ~75% | s("hh*8").often(p => p.gain(0.5)) |
.rarely(fn) | ~25% | s("cp*2").rarely(p => p.fast(2)) |
.always(fn) | 100% | s("bd").always(p => p.gain(0.8)) |
.never(fn) | 0% | s("bd").never(p => p.fast(2)) |
.someCycles(fn) | ~50% per cycle | s("bd").someCycles(p => p.stut(3,0.5,0.1)) |
.degrade(p) | Remove events | s("hh*8").degrade(0.3) |
.degradeBy(p) | Remove with prob | s("hh*8").degradeBy(0.5) |
Random Values
choose("c3", "e3", "g3")
rand()
irand(4)
Song Structure & Arrangement
Control when patterns play during your performance. Unlike a DAW, live coding is performed in real-time - you bring patterns in and out as you go.
Cycle-Based Conditionals
Apply transformations based on the current cycle number.
| Method | Description | Example |
.every(n, fn) | Apply every n cycles | s("bd*4").every(4, p => p.fast(2)) |
.whenmod(div, rem, fn) | Apply when cycle % div === rem | s("bd").whenmod(8, 0, p => p) |
once(pattern) | Play once then silence | once(s("rave")) |
Building Arrangements
d1(s("bd*4").bank("RolandTR909"))
d2(s("hh*8").whenmod(8, 4, p => p).bank("RolandTR909"))
d3(s("~ cp").fast(2).every(8, p => p.fast(4)).bank("RolandTR909"))
d4(s("hh*4")
.whenmod(16, 12, p => p.fast(2))
.whenmod(16, 14, p => p.fast(4)))
Pattern Muting
The easiest way to mute: comment out the line with //
d1(s("bd*4"))
d3(s("cp").fast(2))
Programmatic Muting
| Function | Description |
mute("d1") | Mute pattern without removing it |
unmute("d1") | Unmute pattern |
solo("d1") | Only hear this pattern |
unsolo("d1") | Remove solo |
unsoloAll() | Clear all solos |
hush() | Stop ALL patterns immediately |
Drop/Breakdown Example
d1(s("bd*4").whenmod(16, 12, () => silence()))
d1(s("bd*4"))
d2(s("hh*8").whenmod(16, 12, () => silence()))
d3(s("~ cp").fast(2).whenmod(16, 12, () => silence()))
Polyrhythms & Phase
Create complex rhythmic interactions and stereo effects.
Phase & Rotation
| Method | Description | Example |
.iter(n) | Rotate through n positions over n cycles | note("c e g b").iter(4) |
.palindrome() | Alternate forward/backward each cycle | note("c e g").palindrome() |
.chunk(n, fn) | Apply to alternating n-cycle chunks | s("bd*4").chunk(4, p => p.fast(2)) |
Time Scaling
| Method | Description | Example |
.inside(n, fn) | Speed up, apply fn, slow back down | note("c e g").inside(2, p => p.rev()) |
.outside(n, fn) | Slow down, apply fn, speed back up | note("c e g").outside(2, p => p.fast(3)) |
Layering & Offset
| Method | Description | Example |
.off(offset, fn) | Layer with time-offset copy | note("c e g").off(0.25, p => p.add(7)) |
.jux(fn) | Apply fn to right channel (stereo) | note("c e g").jux(p => p.rev()) |
.juxBy(amt, fn) | Jux with custom pan amount | note("c e g").juxBy(0.5, p => p.fast(2)) |
d1(note("c e g b").s("triangle"))
d2(note("c e g b").s("triangle").slow(1.01).pan(0.7))
note("c3 e3 g3 c4").s("saw").jux(p => p.rev())
note("c3 e3 g3").s("sine").off(0.125, p => p.add(7))
Continuous Signals
Create smooth, continuous modulation sources that aren't triggered by events.
| Function | Description | Example |
signal(fn) | Create custom continuous signal | signal(t => Math.sin(t * Math.PI * 2)) |
sine | Sine wave signal (0-1) | sine.range(200, 2000) |
saw | Sawtooth signal (0-1) | saw.range(0, 1) |
tri | Triangle signal (0-1) | tri.range(0.5, 1) |
square | Square signal (0 or 1) | square.range(0.3, 0.7) |
perlin | Smooth Perlin noise | perlin.range(0, 1) |
Signal Methods
| Method | Description | Example |
.range(min, max) | Scale signal to range | sine.range(200, 2000) |
.segment(n) | Sample n times per cycle | sine.segment(16) |
.slow(n) | Slow down signal | sine.slow(4) |
.fast(n) | Speed up signal | sine.fast(2) |
note("c2").s("saw")
.lpf(sine.range(200, 2000).slow(4))
note("c3 e3 g3").s("triangle")
.pan(perlin.range(-0.7, 0.7))
note("c3").s("pad")
.gain(tri.range(0.3, 1).fast(8))
note("c2").s("saw")
.lpf(saw.segment(8).range(400, 4000))
Synthesizers
Basic Oscillators
Waveforms
sine - Pure tone
saw - Bright, buzzy
square - Hollow, retro
triangle - Soft, flute-like
noise - White noise
Wavetable
pulse - Pulse (50%)
pulse25 - Pulse (25%)
pulse75 - Pulse (75%)
organ - Organ-like
strings - String-like
complex - Complex harmonic
FM Synthesis
note("c3").s("fm")
.set({
fmh: 2,
fmi: 5,
fmattack: 0.01,
fmdecay: 0.2,
fmsustain: 0.5
})
Sample Banks
Creme has access to the full TidalCycles Dirt-Samples library with 200+ sample banks loaded on-demand from CDN. Just use any sample name and it loads automatically!
How to Use Samples
s("bd")
s("arpy").n("0 1 2 3")
s("808:5")
TR909 Drum Machine
Classic Roland TR-909 kit. Use with .bank("RolandTR909")
| Sample | Sound |
bd | Bass drum |
sd | Snare drum |
cp | Clap |
hh | Closed hi-hat |
oh | Open hi-hat |
cr | Crash cymbal |
rd | Ride cymbal |
lt | Low tom |
ht | High tom |
rim | Rim shot |
d1(s("bd*4").bank("RolandTR909"))
d2(s("[~ cp]*2").bank("RolandTR909"))
d3(s("hh*8").bank("RolandTR909"))
Complete Dirt-Samples Library (220+ Banks)
All banks load automatically on first use. Use .n() to select variants within each bank.
Drum Machines
| Bank | Description |
808 | Roland TR-808 full kit |
808bd | TR-808 bass drums |
808sd | TR-808 snares |
808hc | TR-808 hi-hat closed |
808oh | TR-808 open hi-hat |
808cy | TR-808 cymbal |
808ht | TR-808 high tom |
808mt | TR-808 mid tom |
808lt | TR-808 low tom |
808lc | TR-808 low conga |
808mc | TR-808 mid conga |
909 | Roland TR-909 kit |
dr | Drum machine hits |
dr2 | More drum machine |
dr55 | Boss DR-55 |
dr_few | Drum machine selection |
drumtraks | Sequential DrumTraks |
linnhats | LinnDrum hi-hats |
kicklinn | LinnDrum kicks |
gretsch | Gretsch acoustic kit |
Kicks
| Bank | Description |
bd | Bass drums (general) |
clubkick | Club/house kicks |
hardkick | Hard techno kicks |
popkick | Pop/soft kicks |
reverbkick | Reverb kick |
Snares & Claps
| Bank | Description |
sd | Snare drums |
sn | Snare (alias) |
cp | Claps |
realclaps | Real recorded claps |
rm | Rim shots |
rs | Rim shot |
Hi-Hats & Cymbals
| Bank | Description |
hh | Hi-hats closed |
hh27 | More hi-hats (27 samples) |
oh | Open hi-hats |
cr | Crash cymbals |
cb | Cowbell |
ht | High tom |
lt | Low tom |
mt | Mid tom |
Percussion
| Bank | Description |
drum | Various drums |
perc | General percussion |
peri | Peri sounds |
hand | Hand percussion |
tabla | Indian tabla |
tabla2 | More tabla |
tablex | Tabla extended |
click | Click sounds |
clak | Clack sounds |
tink | Tink sounds |
tok | Tok sounds |
hit | Hit sounds |
stomp | Stomp sounds |
Breaks & Loops
| Bank | Description |
breaks125 | Breakbeats at 125 BPM |
breaks152 | Breakbeats at 152 BPM |
breaks157 | Breakbeats at 157 BPM |
breaks165 | Breakbeats at 165 BPM |
amencutup | Amen break slices |
jungle | Jungle breaks |
Bass
| Bank | Description |
bass | Bass sounds |
bass0 | Bass variant 0 |
bass1 | Bass variant 1 |
bass2 | Bass variant 2 |
bass3 | Bass variant 3 |
bassdm | Bass DM |
bassfoo | Bass foo |
jungbass | Jungle bass |
jvbass | JV synth bass |
wobble | Wobble bass |
Synths
| Bank | Description |
juno | Roland Juno synth |
moog | Moog synth |
fm | FM synthesis |
pad | Pad sounds |
padlong | Long pad sounds |
lead | Lead synths |
hoover | Hoover sounds |
psr | PSR keyboard |
sid | SID chip sounds |
simplesine | Simple sine waves |
Stabs & Hits
| Bank | Description |
stab | Chord stabs |
rave | Rave stabs |
rave2 | More rave stabs |
ravemono | Mono rave stabs |
gabba | Gabba sounds |
gabbaloud | Loud gabba |
gabbalouder | Even louder gabba |
gab | Gab sounds |
ulgab | UL gabba |
hardcore | Hardcore sounds |
Melodic & Musical
| Bank | Description |
arpy | Arpeggio notes |
arp | Arp sounds |
pluck | Plucked sounds |
newnotes | New notes |
notes | Musical notes |
gtr | Guitar |
sax | Saxophone |
sitar | Sitar |
casio | Casio keyboard |
Electronic & FX
| Bank | Description |
electro1 | Electro sounds |
future | Future sounds |
glitch | Glitch sounds |
glitch2 | More glitch |
bleep | Bleep sounds |
blip | Blip sounds |
dist | Distorted sounds |
noise | Noise |
noise2 | More noise |
bend | Pitch bend sounds |
control | Control sounds |
proc | Processed sounds |
procshort | Short processed |
speedupdown | Speed up/down FX |
Vocal & Speech
| Bank | Description |
mouth | Mouth sounds |
speech | Speech samples |
speechless | Vocal textures |
speakspell | Speak & Spell |
numbers | Spoken numbers |
alphabet | A-Z letters |
yeah | "Yeah" vocals |
miniyeah | Mini "yeah" |
hc | Human choir |
breath | Breath sounds |
diphone | Diphone synth |
diphone2 | More diphone |
baa | Baa sounds |
baa2 | More baa |
hmm | Hmm sounds |
Nature & Environment
| Bank | Description |
wind | Wind sounds |
birds | Bird sounds |
birds3 | More birds |
insect | Insect sounds |
crow | Crow sounds |
fire | Fire sounds |
outdoor | Outdoor ambience |
space | Space textures |
world | World sounds |
Objects & Foley
| Bank | Description |
bottle | Bottle sounds |
bubble | Bubble sounds |
can | Can sounds |
bin | Bin sounds |
metal | Metal sounds |
glasstap | Glass tapping |
pebbles | Pebble sounds |
coins | Coin sounds |
toys | Toy sounds |
flick | Flicking sounds |
lighter | Lighter sounds |
print | Printer sounds |
Genre-Specific
| Bank | Description |
house | House sounds |
techno | Techno sounds |
jazz | Jazz drums |
industrial | Industrial sounds |
tech | Tech sounds |
east | Eastern sounds |
chin | Chinese sounds |
koy | Koy sounds |
latibro | Latin brother |
Miscellaneous & Experimental
| Bank | Description |
ab | AB sounds |
ade | Ade sounds |
ades2 | Ades 2 |
ades3 | Ades 3 |
ades4 | Ades 4 |
alex | Alex sounds |
armora | Armora sounds |
auto | Auto sounds |
battles | Battle sounds |
bev | Bev sounds |
blue | Blue sounds |
cc | CC sounds |
circus | Circus sounds |
co | CO sounds |
cosmicg | Cosmic G |
d | D sounds |
db | DB sounds |
dork2 | Dork 2 |
dorkbot | Dorkbot sounds |
e | E sounds |
em2 | EM2 sounds |
erk | Erk sounds |
f | F sounds |
feel | Feel sounds |
feelfx | Feel FX |
fest | Festival sounds |
foo | Foo sounds |
h | H sounds |
haw | Haw sounds |
ho | Ho sounds |
if | If sounds |
ifdrums | IF drums |
incoming | Incoming sounds |
invaders | Space invaders |
kurt | Kurt sounds |
led | LED sounds |
less | Less sounds |
made | Made sounds |
made2 | Made 2 |
mash | Mash sounds |
mash2 | Mash 2 |
monsterb | Monster bass |
mp3 | MP3 artifacts |
msg | MSG sounds |
mute | Muted sounds |
num | Number sounds |
oc | OC sounds |
odx | ODX sounds |
off | Off sounds |
sequential | Sequential sounds |
seawolf | Sea wolf |
sf | SF sounds |
sheffield | Sheffield sounds |
short | Short sounds |
subroc3d | Subroc 3D |
sugar | Sugar sounds |
sundance | Sundance sounds |
tacscan | Tac scan |
trump | Trumpet sounds |
ul | UL sounds |
uxay | Uxay sounds |
v | V sounds |
voodoo | Voodoo sounds |
xmas | Christmas sounds |
d1(s("808*4"))
d2(s("arpy").n("0 2 4 6"))
d3(s("tabla").n(irand(16)))
d4(s("rave").n(0).slow(2))
d5(s("jungbass").n("0 3").slow(2))
Note: Samples are loaded from the TidalCycles CDN on first use. There may be a brief delay the first time you use a new sample bank. Once loaded, samples play instantly.
Sample Playback Controls
Control how samples are played back - slice, loop, and manipulate.
| Method | Description | Range |
.speed(n) | Playback speed (negative = reverse) | -4 to 4 |
.begin(pos) | Sample start position | 0-1 |
.end(pos) | Sample end position | 0-1 |
.loop(on) | Enable looping | 0 or 1 |
.loopBegin(pos) | Loop start position | 0-1 |
.loopEnd(pos) | Loop end position | 0-1 |
s("breaks125").begin(0).end(0.5)
s("rave").speed(-1)
s("breaks125").speed(0.5)
s("breaks125*8").begin("0 0.125 0.25 0.375 0.5 0.625 0.75 0.875").end("0.125 0.25 0.375 0.5 0.625 0.75 0.875 1")
s("pad").loop(1).loopBegin(0.2).loopEnd(0.6)
Sample Library (UI)
Click the Samples button in the toolbar to open the Sample Library. Here you can:
- Upload - Drag & drop .wav files to upload your own samples (requires login)
- Browse - View and preview your uploaded samples
Choose a category when uploading, or use "Auto-detect" to categorize based on filename. Your samples sync across devices.
Loading Samples from URLs
Load samples directly from URLs in your code:
| Function | Description |
loadSample(name, url) | Load single sample from URL |
loadSamples({name: url, ...}) | Load multiple samples |
loadSampleBank(bank) | Load entire sample bank with progress |
loadPack(packName) | Load preset pack: 'essentials' or 'all' |
loadSample("mysound", "https://example.com/sound.wav")
s("mysound")
loadSamples({
"kick1": "https://example.com/kick.wav",
"snare1": "https://example.com/snare.wav"
})
loadPack("essentials")
Scales & Notes
.scale(scaleName)
Map pattern values to a musical scale.
mini("0 1 2 3 4 5 6 7").scale("c4:major")
mini("0 2 4").scale("a3:minor")
Available Scales
major, minor, dorian, phrygian, lydian, mixolydian, aeolian, locrian, chromatic, whole, harmonicMinor, melodicMinor
Filters
| Effect | Description | Range |
.lpf(freq) | Low-pass filter | 20-20000 Hz |
.hpf(freq) | High-pass filter | 20-20000 Hz |
.bpf(freq) | Band-pass filter | 20-20000 Hz |
.lpq(q) | Filter resonance | 0.1-30 |
.hpq(q) | HP resonance | 0.1-30 |
.bpq(q) | BP resonance | 0.1-30 |
.ftype(type) | Filter type (0=12db, 1=ladder, 2=24db) | 0-2 |
note("c2").s("saw")
.lpf(800)
.lpq(10)
Envelopes
ADSR (Amplitude)
| Parameter | Description |
.attack(time) | Attack time in seconds |
.decay(time) | Decay time in seconds |
.sustain(level) | Sustain level (0-1) |
.release(time) | Release time in seconds |
note("c2").s("saw")
.attack(0.001)
.decay(0.1)
.sustain(0)
.release(0.05)
.adsr(envelope)
Shorthand: Set all ADSR values with colon-separated string.
note("c3").s("saw").adsr("0.01:0.1:0.7:0.3")
Filter Envelope (Lowpass)
| Parameter | Alias | Description |
.lpattack(time) | .lpa() | Filter attack |
.lpdecay(time) | .lpd() | Filter decay |
.lpsustain(level) | | Filter sustain |
.lprelease(time) | .lpr() | Filter release |
.lpenv(depth) | .lpe() | Filter envelope depth (Hz) |
Filter Envelope (Highpass/Bandpass)
| Parameter | Description |
.hpattack(), .hpdecay(), .hpsustain(), .hprelease(), .hpenv() | Highpass filter envelope |
.bpattack(), .bpdecay(), .bpsustain(), .bprelease(), .bpenv() | Bandpass filter envelope |
note("c2").s("saw")
.lpf(300).lpenv(1500)
.lpa(0.01).lpd(0.2)
.lpq(12)
Pitch Envelope
| Parameter | Alias | Description |
.pattack(time) | .patt() | Pitch attack time |
.pdecay(time) | | Pitch decay time |
.prelease(time) | | Pitch release time |
.penv(semitones) | | Pitch envelope depth |
s("bd")
.pattack(0.001)
.prelease(0.05)
.penv(-12)
Delay & Reverb
Delay
| Parameter | Description |
.delay(amount) | Delay send (0-1) |
.dt(time) | Delay time in seconds |
.dfb(amount) | Delay feedback (0-1) |
note("c3 e3 g3")
.delay(0.5)
.dt(0.25)
.dfb(0.6)
Reverb
| Parameter | Description |
.room(amount) | Reverb send (0-1) |
.roomsize(size) | Room size |
.roomfade(decay) | Decay time |
.roomlp(freq) | Reverb lowpass filter |
.roomdim(freq) | Reverb damping |
Modulation Effects
Vibrato & Tremolo
| Effect | Parameters |
.vibrato(depth) | .vibrate(rate) |
.tremolo(depth) | .tremrate(rate), .tremshape(shape), .tremskew(skew), .tremphase(phase) |
Chorus
| Effect | Parameters |
.chorus(mix) | .chorusrate(rate), .chorusdepth(depth) |
Phaser
| Effect | Parameters |
.phaser(depth) | .phaserrate(rate), .phaserfb(feedback), .phasercenter(freq), .phasersweep(range), .phaserdepth(depth) |
Other Modulation
| Effect | Parameters |
.autowah(depth) | .autowahrate(rate) |
.ringmod(freq) | .ringmix(mix) |
Dynamics & Gain
| Effect | Description |
.gain(level) | Volume (0-1+) |
.postgain(level) | Post-effects gain |
.velocity(vel) | Velocity (0-1) |
.pan(pos) | Stereo pan (-1 to 1) |
.distort(amt) | Distortion |
.crush(bits) | Bit crusher (1-16) |
.coarse(factor) | Sample rate reduction |
.shape(amt) | Waveshaping |
.clip(length) | Note length (0-1) |
.cut(group) | Cut group (stops other samples in group) |
.vowel(v) | Vowel formant (a, e, i, o, u) |
Compressor
| Parameter | Description | Range |
.compressor(ratio) | Compression ratio | 1-20 |
.compressorThreshold(db) | Threshold in dB | -60 to 0 |
.compressorAttack(time) | Attack time (seconds) | 0.001-1 |
.compressorRelease(time) | Release time (seconds) | 0.01-1 |
.compressorKnee(db) | Knee softness | 0-40 |
s("bd*4")
.compressor(8)
.compressorThreshold(-20)
.compressorAttack(0.003)
.compressorRelease(0.1)
Sidechain Ducking
| Parameter | Description | Range |
.duckorbit(n) | Duck when orbit n plays | 0+ |
.duckattack(time) | Duck attack time | 0.001-1 |
.duckrelease(time) | Duck release time | 0.01-2 |
.duckdepth(depth) | Duck amount (0-1) | 0-1 |
d1(s("bd*4").gain(1))
d2(note("c2").s("saw")
.duckorbit(0)
.duckattack(0.01)
.duckrelease(0.2)
.duckdepth(0.8))
Mini-Notation Basics
Mini-notation is a compact syntax for rhythmic patterns.
mini("bd sd hh cp")
mini("bd ~ sd ~")
mini("[bd sd] hh")
mini("<bd sd hh>")
Mini-Notation Operators
| Operator | Description | Example |
* | Multiply/repeat | "bd*4" → 4 kicks |
/ | Divide/slow | "bd/2" → half speed |
@ | Weight/duration | "bd@4" → 4x duration |
! | Replicate | "bd!3" → bd bd bd |
~ | Rest/silence | "bd ~ sd ~" |
. | Hold previous | "bd . sd ." |
[ ] | Subdivision | "[bd sd]" |
< > | Alternation | "" |
, | Stack/chord | "[0,2,4]" |
? | Probability | "bd?" → 50% |
( ) | Euclidean | "(3,8)" → 3 in 8 |
Arithmetic Operations
Modify pattern values mathematically.
| Method | Description | Example |
.add(n) | Add to values (transpose) | note("c3").add(7) (up a 5th) |
.sub(n) | Subtract from values | note("c3").sub(12) (down octave) |
.mul(n) | Multiply values | note("c3").mul(2) |
.div(n) | Divide values | note("c3").div(2) |
Visualization
Visual feedback for patterns. Methods prefixed with underscore.
Pianoroll
note("c3 e3 g3 c4").s("triangle")
._pianoroll({ cycles: 4 })
Options: cycles (number of cycles to display), vertical (boolean)
Oscilloscope
note("c3").s("saw")
._scope(150)
Punchcard
s("bd*4 [~ sd]*2")
._punchcard({ cycles: 2 })
Color
note("c3").color("#ff0088")
Interactive Controls
slider(id, label, min, max, step, default)
const cutoff = slider('cutoff', 'Filter', 200, 5000, 50, 1200);
note("c3").s("saw").lpf(cutoff)
toggle(id, label, default)
const reverb = toggle('reverb', 'Reverb', false);
note("c3").room(reverb ? 0.7 : 0)
select(id, label, options, default)
const wave = select('wave', 'Wave', ['sine', 'saw', 'square'], 'saw');
note("c3").s(wave)
Advanced Methods
| Method | Description |
.collect() | Collect pattern events into array |
.restart(pat) | Reset phase on trigger |
.pick(patterns) | Pick from array based on value |
.as(name) | Name a pattern |
register(name, fn) | Register custom function |
.fmap(fn) | Map over pattern values |
.set(props) | Set multiple properties |
.appWhole(fn) | Apply pattern of functions |
alignWith(strategy, fn, patA, patB) | Combine patterns with alignment |
run(n) | Create sequence 0,1,2...n-1 |
Pattern Alignment
Control how patterns are combined with alignWith.
| Strategy | Description |
'left' | Keep timing of left pattern |
'right' | Keep timing of right pattern |
'both' | Combine both timings |
'squeeze' | Squeeze patterns together |
'squeezeRight' | Squeeze from right side |
alignWith('left', (a, b) => a + b,
note("c3 e3"),
note("0 7")
)
Custom Function Example
const myFn = register('myFn', (value, pat) => {
return pat.fmap(v => ({ ...v, gain: value }));
});
note("c3").myFn(0.5)
Test Examples
Quick single-line examples to test each feature. Copy and paste to verify functionality.
Basic Playback
d1(s("bd sd hh oh"))
Sample Index (.n)
d1(s("clubkick*4").n("<0 1 2 3 4>"))
Notes
d1(s("sine*4").note("c4 e4 g4 c5"))
Gain
d1(s("bd*4").gain("<0.3 0.5 0.8 1>"))
Pan
d1(s("hh*8").pan(sine.range(0, 1)))
Speed
d1(s("bd*4").speed("<1 1.5 2 0.5>"))
Low-Pass Filter
d1(s("saw*4").note("c3").lpf("<200 400 800 1600>").lpq(5))
High-Pass Filter
d1(s("saw*4").note("c3").hpf("<100 200 400 800>"))
Attack Envelope
d1(s("saw*2").note("c3 e3").attack(0.3).release(0.5))
Decay/Sustain
d1(s("sine*4").note("c4").decay(0.2).sustain(0.3))
Delay
d1(s("cp*2").delay(0.5).delaytime(0.25).delayfeedback(0.5))
Reverb
d1(s("sd*2").room(0.8).size(0.9))
Bitcrusher
d1(s("bd*4").crush(4))
Compressor
d1(s("bd sd bd sd").compress(0.5).compressorRatio(8))
Sidechain Ducking
d1(s("bd*4"))
d2(s("saw").note("c2").lpf(400).duckorbit(0).duckattack(0.01).duckrelease(0.2).duckdepth(0.8))
Velocity
d1(s("hh*8").velocity("0.3 0.5 0.7 1 0.3 0.5 0.7 1"))
Filter Type (Ladder/24dB)
d1(s("saw").note("c2").lpf(400).lpq(8).ftype(1))
Sample Rate Reduction (Coarse)
d1(s("bd*4").coarse(8))
Waveshaping
d1(s("saw").note("c2").shape(0.7).lpf(800))
Post-Effects Gain
d1(s("saw").note("c2").distort(0.5).postgain(0.5))
Pitch Envelope (808 Kick)
d1(s("sine*4").note("c1").penv(24).pattack(0.001).pdecay(0.05).decay(0.3).sustain(0))
HP Filter Envelope
d1(s("saw").note("c2").hpf(100).hpenv(2000).hpattack(0.01).hpdecay(0.3))
Advanced Tremolo
d1(s("saw").note("c3").tremolo(0.8).tremrate(4).tremshape("square"))
Advanced Phaser
d1(s("saw").note("c3").phaser(1).phaserrate(0.3).phasercenter(800).phasersweep(600))
Advanced Reverb (Dark Room)
d1(s("cp*2").room(0.8).roomsize(3).roomlp(2000).roomdim(0.5))
Fast/Slow
d1(s("bd sd hh sd").fast(2))
d1(s("bd sd hh sd").slow(2))
Euclidean Rhythms
d1(euclid(5, 8, "bd"))
Stack
stack(
s("bd*4"),
s("~ sd ~ sd"),
s("hh*8").gain(0.5)
)
Sequence
d1(seq("bd", "sd", "bd bd", "sd"))
Reverse
d1(s("arpy*4").n("<0 1 2 3>").rev())
Jux (Stereo Split)
d1(s("arpy*4").n("<0 1 2 3>").jux(x => x.rev()))
Every N Cycles
d1(s("bd*4").every(4, x => x.fast(2)))
Sometimes
d1(s("hh*8").sometimes(x => x.speed(2)))
Iter (Rotate)
d1(s("bd sd hh oh").iter(4))
Palindrome
d1(s("bd sd hh oh").palindrome())
Chunk
d1(s("bd sd hh oh hh sd bd oh").chunk(4, x => x.rev()))
Off (Offset Echo)
d1(s("bd sd").off(0.125, x => x.speed(1.5).gain(0.5)))
Degrade (Random Drops)
d1(s("hh*16").degrade())
Mini-Notation
d1(mini("[bd sd] hh [bd bd] sd"))
Synths
d1(s("sine").note("c3 e3 g3 c4").attack(0.01).decay(0.1).sustain(0.5).release(0.3))
d1(s("saw").note("c2").lpf(400).gain(0.5))
d1(s("square").note("e4 g4").gain(0.3).lpf(1000))
Signals (LFO)
d1(s("saw*4").note("c3").lpf(sine.range(200, 2000).slow(4)))
Multiple Orbits
d1(s("bd*4"))
d2(s("hh*8").gain(0.4))
d3(s("~ sd ~ sd"))
Clip Duration
d1(s("pad").note("c3 e3 g3").clip(0.5))
Chop (Slice Sample)
d1(s("breaks165").chop(8))
Stutter
d1(s("bd sd").stut(3, 0.5, 0.125))
Hush (Stop All)
hush()
Recipes & Examples
Copy-paste these complete examples to get started quickly.
Basic House Beat
d1(s("bd*4").bank("RolandTR909"))
d2(s("~ cp").fast(2).bank("RolandTR909"))
d3(s("hh*8").gain(0.4).bank("RolandTR909"))
Acid Bassline
d1(note("c2 c2 c3 c2 eb2 c2 f2 c2")
.s("saw")
.lpf(800).lpq(15)
.lpenv(2000).lpa(0.01).lpd(0.1)
.attack(0.001).decay(0.1).sustain(0))
Build-up with Drop
d1(s("bd*4").bank("RolandTR909"))
d2(s("hh*8").whenmod(16, 12, () => silence()).bank("RolandTR909"))
d3(s("~ cp").fast(2).whenmod(16, 12, () => silence()).bank("RolandTR909"))
d4(s("hh*4")
.whenmod(16, 14, p => p.fast(4))
.whenmod(16, 15, p => p.fast(8))
.bank("RolandTR909"))
Ambient Pad with LFO
d1(note("[c3,e3,g3] [f3,a3,c4]").slow(2)
.s("pad")
.lpf(sine.range(500, 2000).slow(8))
.room(0.8).roomsize(0.9)
.attack(0.5).release(2))
Polyrhythmic Percussion
d1(euclid(3, 8, "bd").s().bank("RolandTR909"))
d2(euclid(5, 8, "hh").s().gain(0.5).bank("RolandTR909"))
d3(euclid(7, 16, "cp").s().gain(0.6).bank("RolandTR909"))
Stuttering Lead
d1(note("c4 e4 g4 b4")
.s("saw")
.every(4, p => p.stut(4, 0.5, 0.125))
.lpf(2000)
.delay(0.3).dt(0.25).dfb(0.4))