Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Quick reference

Everything on one page. Each name links to its full entry.

Starting

song("house", 7)a generated song; options #{ seed, bpm, key, short, loops, samples }
blank("house")an empty song: one 8-bar section, no tracks, progression A = the tonic chord, the genre’s mix
(neither)edit the open song, or a blank house song when none is open

Song edits

title("Night Drive")
tempo(124), bpm(124)40..240
key("A minor")"F#m", "Eb", "D dorian", "E harmonic minor"
swing(0.56)0.5 straight .. 0.8; sixteenth-note swing
humanize(0.3)0..1
prog("A", "i7 VImaj7 iv7 v7")numerals, chord names, slash chords; sections play A, breaks B (or A)
bars_per_chord(2)bars each chord lasts, 1..8
drum("kick", "X...x...")X 1.0, x 0.8, o 0.45, 1-9, . rest; drum(lane, variant, steps, per_bar)
trig("hat", 14, #{ ratchet: 3, cond: "1:2" })a step’s chance, condition, ratchet, flam, nudge and locks (pitch, decay, tone, pan)
lane("hat", #{ length: 12, groove: "dilla" })a lane’s own length (a polymeter), speed, swing and groove
groove("funk", "loops/funk.wav")a groove heard in a recording’s drums (or written as a table), for lanes to play in
drums_from("beat.wav", #{ bars: 2 })a beat in a recording, played or beatboxed, into the kick, snare and hat lanes
drum_sound("kick", "tr909:bd")a drum name, a kit sound (or a name and a bank), a file
part("bass", #{ ... })role style preset register density seed rate; adds the genre’s part when the song has none, and with role one of your own
notes("lead", "A", [[0, 0.5, 69], ...]), clear_notes("lead", "A")a part’s notes over a progression written out, [start, length, pitch, velocity] in beats; cleared, the theory engine’s again
track("hats", pattern)a pattern track; new ones join sections with energy ≥ 0.6
rack("bass", [#{ sound: "sub_bass", band: [0, 100] }, ...])several sounds playing a track at once, each in its band, with its level, duck and effects
mix("pad", #{ ... })level −40..12, pan −1..1, reverb/room, delay, duck 0..1, mute, solo
master(#{ lufs: -9, ceiling: -1 })−24..−5 LUFS, −3..−0.1 dBTP
mute() unmute() solo() unsolo() remove()by track name

Form

form([sec(...), ...])the whole form; repeated names become drop2, drop3
sec(kind, bars, layers)kinds intro verse build drop break hook groove outro bridge; layers "kick hat", [...], "*"
.name() .energy() .prog() .variant()
.build() .gap() .impact() .fills() .filter_in()each also takes true / false; .build("roll+riser") stacks styles, .build_bars(4) builds over the last 4 bars, .gap(2) holds 2 beats
section("drop", #{ ... })bars energy prog variant name layers build gap impact fills filter_in; by name or 0-based index
layer("break", "lead", true)one track on or off in one section

Patterns

constructorvalues
s("bd sd"), sound()sound names
note("c3 e3 g3")note names (octave 3 by default) or MIDI numbers
n("0 2 4")scale degrees (.scale(), else the song’s key)
chord("<Am7 F/A>")chord symbols, slash chords, numerals, prog, prog:B
seq("1 0 1 1")plain values
stack([...]), cat([...]), silence()together / one per bar / nothing

Mini-notation

a b csequence over one bar
~, -rest
[a b], {a b}group in one step
a, btogether
<a b c>one per bar
a | brandom pick per bar
a*2, a/2faster, slower; above 0, up to 256
a@3, a _ _weight
a!3, a !repeat
a?, a?0.3drop at random
a(3,8), a(3,8,2)euclidean
bd:3, tr808:sd:2variation: a number after the last colon
F/A, V7/Va slash before a letter stays in the word

Pattern methods

.fast(2) .slow(2)speed; above 0, up to 256
.late(0.25) .early(0.125)shift (cycles = bars)
.rev() .ply(2)reverse each bar, repeat each event (1 to 256 times)
.every(4, f) .lastOf(4, f)first / last bar of every n, from the section start
.sometimes(f) .often(f) .rarely(f) .almostNever(f) .almostAlways(f) .sometimesBy(p, f)per event, seeded
.off(0.125, f) .superimpose(f)shifted copy, copy on top
.degrade() .degradeBy(0.3)drop events, seeded
.struct("x ~ x x") .mask("1 0 1 1")rhythm from another pattern
.euclid(3, 8) .euclidRot(3, 8, 2)euclidean rhythm
.gain() .velocity() .legato()per event; numbers or patterns
.add(2) .transpose(12)add to the value (degrees on n()) / semitones always
.n("0 1 2")variation, on sound patterns

Track settings

.s(name), .sound(name)instrument for note / degree / chord patterns
.bank("tr909")tr909 tr808 tr707 acoustic uzu synthdrums sonicpi body apple
.scale("A:minor")also dorian phrygian lydian mixolydian harmonic_minor minor_pentatonic pentatonic blues chromatic
.octave(4)octave of degree 0 and of note names without one
.voicing(), .voicing(48, 72)chord range, default 52..74
.arp("up")up down updown
.root()a chord pattern’s roots (or slash basses), octave 2
.role("pad")mixing role
.level(-3) .pan(-0.4) .room(0.3) .delay(0.2) .duck(0.5)mix
.lpf(1200) .hpf(200) .crush(8) .distort(6)inserts

Sounds

drumsbd sd cp hh oh rd cr lt mt ht rim sh cb snap perc (and kick snare clap hat ohat ride crash tom rs shaker cowbell ch)
synthssub_bass 808 reese acid saw_bass pluck_bass organ_bass wobble log_drum pluck supersaw pad warm_pad stab epiano keys bell organ strings square_lead chip fm_bass rubber_bass moog_bass dist_bass deep_bass saw_lead pwm_lead whistle soft_lead glide_lead brass_lead fm_lead vox_lead solina glass_pad pwm_pad air_pad vowel_pad swell_pad tine_piano clav house_piano brass_stab rock_organ fm_marimba fm_kalimba harp_pluck mallet cowbell_lead
sampledpiano upright rhodes wurlitzer hammond string_ensemble violins cellos pizzicato brass trumpet flute harp marimba vibes kalimba upright_bass bass guitar choir sax bongo conga ...
exactvsco2:violins, tr808:sd, in .s() or in s() patterns
files.s("/path/sound.wav"): c4 plays it as recorded

Roles and targets (LUFS while playing)

kick −12.5 · snare −13.5 · clap −14.5 · hat −17.5 · ohat −18.5 · perc −19.5 · shaker −21.5 · ride −20.5 · tom −18 · crash −20 · bass −14.5 · keys −17 · chords −18 · lead −18 · arp −20.5 · pad −21.5 · vocal −15 · anything else −19.