Chapter 6 — Drum Machines Are Sample Players
Here’s the thing nobody tells you: a drum machine is the instrument you built in Chapter 5, with the pitch-shifting turned off. One WAV per sound, triggered at scheduled positions. The LinnDrum that defined a decade of records is a sample player with a sequencer bolted to it.
Which means the interesting question isn’t how to play a kit. It’s how to choose one — and that turns out to be where most of the craft lives.
Audition in the mix, not in isolation
A kick drum auditioned on its own tells you almost nothing. What matters is what its tail does underneath a bass line, and you cannot hear that until the bass is playing. So when you’re choosing a kit, render the same section through every candidate and listen to it in context: same groove, same processing, same comparison level, so the kit is genuinely the only variable.
View the comparison of eight drum machine kicks
Look at how differently sampled kicks behave in attack, length and shape. That picture is not a ranking — it’s an argument for auditioning. A short kick may leave exactly the room a sustained bass needs. A longer one may be the low end the arrangement was missing. The waveform can’t tell you which, and neither can I.
This is also where Chapter 1’s for-loop argument stops being abstract. The DAW way to choose a kit is to swap sounds in by hand, get through three or four, get tired, and settle. The script way is a loop over candidate kit paths, and a blind listen at the end of it. The winner is frequently not the machine the genre’s history says it should be.
Treat each sample as a source with a format
Use recordings you made, or samples licensed for what you actually intend to do. Keep the source and its terms with the local kit — a download link is not a permission record, and you will not remember in a year. (The public repository doesn’t include the studio’s drum samples for exactly this reason.)
A WAV is not necessarily 16-bit, mono or 44.1 kHz, whatever the last ten files you opened happened to be. Drum samples in particular arrive from every era of computing, and some of them are older than you are. The shared reader handles integer and float PCM, centers unsigned 8-bit data, and resamples from whatever rate the file actually declares:
from music_engine.samplers import read_sample
rate = 44100
kick = read_sample('/path/to/your-kit/kick.wav', rate)
You get frames by channels for a stereo file, or a one-dimensional array for mono. Hold on to that distinction until you’ve decided deliberately how the kit should sit in the stereo image. Casting everything to float and dividing by 32768 works beautifully for exactly one encoding and silently mangles the rest — unsigned 8-bit audio treated that way comes out with a large DC offset and a click on every hit.
Fix the pattern before comparing kits
Write hit positions in beats, then convert to sample positions at the final tempo. Here’s a minimal mono example putting a kick down four times:
import numpy as np
from scipy.io import wavfile
bpm = 80
beat = 60 / bpm
mono = kick.mean(axis=1) if kick.ndim == 2 else kick
bus = np.zeros(round((4 * beat + 2) * rate), np.float32)
for beat_position, gain in [(0, .7), (1, .5), (2, .7), (3, .5)]:
start = round(beat_position * beat * rate)
count = min(len(mono), len(bus) - start)
bus[start:start + count] += mono[:count] * gain
assert np.isfinite(bus).all()
wavfile.write('kit-pattern.wav', rate, bus)
The bus is four beats plus two spare seconds, because the last kick needs
somewhere to ring out. count clamps the copy so a long sample near the end of
the bus doesn’t run off the edge of the array. And += rather than = means
overlapping hits sum, the way two drums in a room would.
For a real audition harness, make the kit path the variable and reuse this same pattern for all of them. Keep an unprocessed version for diagnosis and a version through the actual drum bus for the musical decision; they answer different questions and you want both. Compare at matched listening levels, too — peak-normalizing two samples can still leave one obviously louder, and louder wins auditions it hasn’t earned.
Keep a stable rhythmic reference
Sign-Off renders its LM-2 kick, snare and closed hat at final-tempo positions. The pitched sources go off through the slowdown and warble path described in Chapter 7; the drum attacks skip that timing warp entirely. The kit can still be filtered and balanced however the track needs — it simply never leaves the beat.
That’s a musical decision with a routing consequence, and it’s worth stating as a principle: when something in your mix is going to drift, something else should stay put. The ear tolerates a great deal of instability as long as it has one thing to hold on to.
Contrast comes from the arrangement as much as the kit. Some tracks on the record run on a slow heartbeat pattern, some on a steady beat, some on nothing at all. One strong kit covers that whole range as long as the pattern and the texture around it have a reason for existing.
Check the dense passages and the transitions, not just the opening bar, which always sounds fine. Listen for kick and bass masking each other, for hats that turn tiring by the third minute, for tails clipped short by the export. Then, once you’ve chosen, save the performed drum bus with the other dry sources so your later mix comparisons reuse exactly the same hits.
Next — Chapter 7: Synthesis from a Few Sine Waves.