Your First Groove
On this page you build one drum groove with the rest of mini-notation — the symbols inside a pattern’s brackets. At the end, you read a dense pattern at a glance.
Start with Pattern Basics. Write each step into
src/main.non, select it, and press Cmd+Enter. Every step adds to what the previous one built.
Before you start
Section titled “Before you start”Finish Pattern Basics. Open src/main.non, evaluate
RESET; on its own, then remove that line. Check that the earlier drums and bass are silent.
The setup below makes a new drums track; evaluate later blocks in order.
Start the groove
Section titled “Start the groove”use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.set_instrument(Sampler(Kit("TR-808")));
drums << [bd sd bd sd];
PLAY;Divide one step
Section titled “Divide one step”Put a pattern inside a step, and it divides only that step:
drums << [bd sd bd [sd sd]];The last step plays two snares, each half as long. Go one level deeper:
drums << [bd sd bd [sd [sd sd]]];The last half of the last step divides again: a small roll into the next bar. The groups need not be
the same size — [bd [sd sd sd]] puts a triplet in the second half.
Layer different lengths
Section titled “Layer different lengths”Each layer of a comma divides the cycle by its own number of steps:
drums << [bd bd bd, cp cp];Three kicks against two claps: they meet only on the downbeat. Now a real groove in three layers:
drums << [bd _ bd _, _ sd _ sd, ch ch ch ch];Change one step each cycle
Section titled “Change one step each cycle”Angle brackets inside a step change only that step, cycle by cycle:
drums << [bd _ bd _, _ sd _ <sd [sd sd]>, ch ch ch ch];The last snare is single in one cycle and double in the next.
Play a step faster
Section titled “Play a step faster”*n plays a step n times in its own slot:
drums << [bd _ bd _, _ sd _ <sd [sd sd]>, ch*8];Eight hi-hats, with one symbol instead of eight steps.
Make a step longer
Section titled “Make a step longer”@n gives a step n shares of the cycle instead of one:
drums << [bd@3 sd, ch*8];The kick holds three quarters of the cycle, and the snare comes late, on the last quarter.
Repeat a step
Section titled “Repeat a step”!n writes a step n times, as if you had typed it out:
drums << [bd!3 sd, ch*8];[bd!3 sd] expands to [bd bd bd sd]: four equal steps. Unlike *, ! adds steps to the
sequence, so all four divide the cycle anew.
Slow a group down
Section titled “Slow a group down”/n stretches a step over n cycles:
drums << [bd sd, ch*8, <_ oh>/2];The open hat alternates with silence, but each choice now lasts two cycles.
Accent a hit
Section titled “Accent a hit”^ sets a hit’s velocity, from 0 to 127:
drums << [bd sd, ch^120 ch^60 ch^80 ch^60 ch^120 ch^60 ch^80 ch^60];The hi-hats get louder and softer in a pattern of their own.
Read it all
Section titled “Read it all”drums << [bd <sd [sd sd]>, ch*8, <_ oh>];Read it comma by comma:
bd <sd [sd sd]>— a kick, then a snare that is single in one cycle and double in the next.ch*8— eight closed hi-hats.<_ oh>— an open hi-hat in every second cycle.
STOP;Next steps
Section titled “Next steps”- Melody and Harmony in a Key — the next tutorial: degrees, chords and changing key
- Transform a Pattern — make variations with
.fast(),.reverse(),.transpose()and more - Write Polymetric and Euclidean Rhythms — loops that drift, and rhythms from two numbers
- Mini-Notation Grammar — every symbol, and the order they combine in