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

Copy-paste templates for common patterns.

Track Skeleton

use_bpm 100

# === SOUNDS ===
define :kick do |v=1|
  sample :bd_tek, amp: 2.2*v, rate: 0.9
  sample :bd_boom, amp: 0.5*v, rate: 1.2
end

define :snare do |v=1|
  sample :sn_dub, amp: v, rate: 0.85
end

define :hat do |v=1|
  sample :drum_cymbal_closed, amp: 0.25*v, rate: 2.2, release: 0.05
end

define :bass do |n, v=1, c=80|
  use_synth :tb303
  play n, amp: 0.8*v, attack: 0.01, decay: 0.2, 
       sustain: 0.1, release: 0.15, cutoff: c, res: 0.3
  use_synth :sine
  play n-12, amp: v, attack: 0.01, sustain: 0.25, release: 0.2
end

define :lead do |n, dur=0.5, v=1|
  use_synth :prophet
  play n, amp: 0.4*v, attack: 0.05, decay: dur*0.25,
       sustain: dur*0.45, release: dur*0.5, cutoff: 90
end

define :hit do |v=1|
  sample :bd_boom, amp: 2*v, rate: 0.4
end

# === PATTERNS ===
define :drums do |k=1, s=1, h=1|
  in_thread do
    4.times { kick k; sleep 1 }
  end
  in_thread do
    sleep 1; snare s; sleep 1; snare s; sleep 2
  end
  in_thread do
    8.times { hat h; sleep 0.5 }
  end
  sleep 4
end

define :bassline do |v=1, c=80|
  bass :d2, v, c; sleep 1
  bass :d2, v*0.7, c-10; sleep 1
  bass :f2, v*0.9, c; sleep 1
  bass :d2, v, c; sleep 1
end

define :melody do |v=1|
  lead :d4, 0.5, v; sleep 0.5
  lead :f4, 0.5, v*0.9; sleep 0.5
  lead :a4, 1, v; sleep 1
  lead :g4, 0.5, v*0.85; sleep 0.5
  lead :d4, 1, v; sleep 1.5
end

# === ARRANGEMENT ===

# INTRO: 8 bars
in_thread do
  8.times { drums 0.7, 0, 0.4 }
end
in_thread do
  with_fx :lpf, cutoff: 50, cutoff_slide: 32 do |fx|
    control fx, cutoff: 80
    8.times { bassline 0.5, 50 }
  end
end
sleep 32

# BUILD: 8 bars
in_thread do
  8.times { drums 0.85, 0.7, 0.55 }
end
in_thread do
  8.times { bassline 0.75, 68 }
end
sleep 32
hit 1

# MAIN: 12 bars
in_thread do
  12.times { drums 1, 0.9, 0.7 }
end
in_thread do
  12.times { bassline 1, 80 }
end
in_thread do
  with_fx :reverb, room: 0.6, mix: 0.4 do
    sleep 16
    4.times { melody 0.8 }
  end
end
sleep 48

# OUTRO: 6 bars
in_thread do
  6.times { |i| drums (1-i*0.12), (0.85-i*0.1), (0.7-i*0.08) }
end
sleep 24

Common Effects Chains

Standard Lead

with_fx :reverb, room: 0.6, mix: 0.4 do
  with_fx :echo, phase: 0.5, decay: 3, mix: 0.3 do
    # lead code
  end
end

Ethereal/Break

with_fx :reverb, room: 0.95, mix: 0.6 do
  with_fx :echo, phase: 1, decay: 6, mix: 0.5 do
    # lead code
  end
end

Tight/Peak

with_fx :reverb, room: 0.5, mix: 0.25 do
  with_fx :echo, phase: 0.5, decay: 2, mix: 0.2 do
    # lead code
  end
end

Filter Build

with_fx :lpf, cutoff: 50, cutoff_slide: 32 do |fx|
  control fx, cutoff: 110
  # bass code for 32 beats
end

Timing Values

ValueNamePer Bar
4Whole note1
2Half note2
1Quarter note4
0.5Eighth note8
0.25Sixteenth note16
0.75Dotted eighth~5.3

Volume Guidelines

ElementTypical Range
Kick sample2.0 - 2.5
Snare0.8 - 1.1
Hi-hat0.2 - 0.3
Bass synth0.6 - 0.9
Sub sine1.0 - 1.2
Lead0.35 - 0.45
Arp0.2 - 0.3
Pad0.25 - 0.4

Section Energy Levels

SectionDrumsBassLead
Intro0.7, 0, 0.40.5-
Build0.85, 0.7, 0.550.750.5
Main1, 0.9, 0.710.8
Break0, 0, 0.35-0.5
Peak1.15, 1.05, 0.81.10.95
Outrofadefade0.4

Minor Scale Notes

Key1234567
D minDEFGABbC
E minEF#GABCD
A minABCDEFG
G minGABbCDEbF
C minCDEbFGAbBb
B minBC#DEF#GA
F minFGAbBbCDbEb