Act II gave you patterns of notes. A machine groove needs more: a different loudness, a different place in the field, a different sample on every hit. The same mini-notation drives all of them — one lane per parameter, zipped onto the track.
sound !"hh*8" |> gain !"1 0.45 0.8 0.45" hangs a lane off the track. The lane is sampled stepwise at each hit's onset and that value multiplies into the note's velocity. A lane shorter than the track wraps rather than stretching to fit — four numbers against eight hats repeat twice.
There are eight lanes: gain (per-hit dynamics), pan (placement), speed (sampler rate), push (signed milliseconds of micro-timing), warp, pitch + pitchRoot, and variantP (which kick sounds this cycle). A rest in a lane holds the previous value rather than zeroing it.
A lane's argument is an ordinary pattern, so the combinators compose: |> gain (!"1 0.4 0.85 0.4" |> every 2 rev) unrolls to a two-cycle lane that the sampler walks — the accents flip every other bar.
# merges two patterns, and the bar marks which side owns the structure: !"cp ~ cp ~" # ctrl "gain" !"1 0.55" keeps the left side's onsets and samples and takes only values from the right. Its siblings |+ +| |* *| add and multiply instead of overriding, and the merge is unit-checked — adding hertz to a normalized scalar is a compile error, not a silent bug.
The same idea reaches inside a patch: hand @ a pattern instead of a constant and the LFO's rate follows it, one step per cycle. Each step of !"<0.5 0.25 0.1875>"c is a period in cycles — half, quarter, dotted eighth: the whole dubstep wobble vocabulary from one patch.
The starting point#
The lesson opens with this song in the editor. Every edit recompiles and plays.
-- Pattern controls: every hat is the same hat. Machine-flat.
tempo = 140bpm
wob = patch {
source = saw (freq pitch),
cutoff = 300Hz + (lfoSine @ 1/2c |> scale [0, 1]) * 2600Hz,
ampEnv = adsr 5ms 120ms 0.8 140ms,
gain = vel * 0.4
}
bass = play wob !"c2 ~ eb2 c2"
kit = sound !"bd ~ sn bd"
hats = sound !"hh*8"
What to watch#
Watch the scope's height change hit to hit once the gain lane lands — the hats stop drawing eight identical spikes. On the rate lane, the spectrum's moving notch changes speed at each bar line without ever jumping: the LFO's phase free-runs across a rate change.
Goals#
The workbench checks these as you work; the solution is there when you want it.
- Accent the hats with a gain lane
- Open the groove sideways with a pan lane
- Merge two patterns with # (or |+, |*)
- Stretch: give the wobble a rate lane
Make it yours#
Take one drum track and give it three lanes at once — gain for the accents, pan for the width, and variantP for a different kick each cycle. Then delete the gain lane and hear how much of the groove was in it.
Further reading#
Control patterns for individual events in the reference.