Rhythm606
The Rhythm606 is a small analog drum machine with seven sounds, one circuit per pad, inspired by the Roland TR-606 Drumatix. Every drum sound is generated by dedicated analog-style circuits: bridged-T resonators for the kick and toms, a thin dual-tone body under high-passed white noise for the snare, and a six-oscillator metallic bank voiced thin and bright for the hats and cymbal.
import audioinstruments._rack.adapter as adapter
inst = adapter.create(48000, voice="rhythm606") # 7 voices, 1 per sound
audio_out.play(inst.output)
inst.program_change(0) # Drumatix
inst.note_on(36, 127) # Accented Bass Drum
inst.note_on(38, 100) # Snare Drum
Sounds and circuits
You play seven distinct drum circuits mapped to General MIDI percussion keys:
voice |
sound |
keys |
panel controls |
|---|---|---|---|
0 |
bass drum (BD) |
35, 36 |
level |
1 |
snare drum (SD) |
38, 40, 37, 39 |
level |
2 |
low tom (LT) |
41, 43, 45 |
level |
3 |
high tom (HT) |
47, 48, 50 |
level |
4 |
cymbal (CY) |
49, 51, 57 |
level |
5 |
open hi-hat (OH) |
46 |
level |
6 |
closed hi-hat (CH) |
42, 44 |
level |
The bass drum is a bridged-T resonant filter tuned near 56 Hz. It drops by about 140 cents over its initial 25 ms, with a snappy, bright strike click centered at 2.8 kHz and a tight 200 ms decay to -40 dB.
The snare drum combines two bridged-T resonant body tones near 195 and 330 Hz with a prominent burst of high-passed white noise (2.2 kHz cutoff). The tone body sits low beneath a crisp, papery snare wire decay lasting about 150 ms.
The low and high toms use bridged-T oscillators tuned near 120 Hz and 180 Hz with a 75-cent downward bend and a touch of membrane noise, decaying over 250 ms.
The metallic bank drives the closed hat, open hat, and cymbal from six unrelated square-wave oscillators (205.3, 304.4, 369.6, 522.7, 540, and 800 Hz). The hi-hats pass through a band-pass at 8 kHz and a high-pass at 7.8 kHz for a thinner, crisper tone than the 808’s. The closed hat decays rapidly in 38 ms, while the open hat rings for 250 ms. The cymbal splits the metallic sum across 3.6 kHz and 7.5 kHz resonant bands, mixed with high-passed white noise for a splashy 800 ms ring.
The choke and additions
On the original instrument, the two hats shared one circuit so a closed hat
stopped an open one. In Rhythm606, open and closed hats share a mutual choke
group (CHOKE = ((5, 6),)): triggering either hat cuts off the other over a
single block fade.
The panel matches the original with a level control per sound (bd_level,
sd_level, lt_level, ht_level, cy_level, oh_level, ch_level, all
default 7.0), accent (default 5.0) and volume (default 7.0). Two common
modifications are added that were not on the original:
tune(0 to 10, default 5.0): sweeps every drum’s pitch by +/- 4 semitones.decay(0 to 10, default 5.0): scales every sound’s decay time by x0.5 to x2.
Accent and output
MIDI velocity serves as the accent. The accent parameter scales the dynamic
range and brightens the kick click, snare snap, and cymbal top end.
The output stage routes the mono voice sum through volume and a soft ceiling
tanh saturator to prevent hard clipping when all seven sounds hit together.
inst.latency_samples is 0.
Patches and macros
There are four factory presets:
Drumatix: all controls fresh, replicating the standard machine.
Acid: boosted kick level (9.0), closed hat level (8.0), and accent (8.0).
Tight: clipped decay (2.0) and raised tune (6.0).
Loose: extended decay (8.0) and lowered tune (4.0) for deep drums and splashy cymbal.
The six macros are tune, decay, accent, bd_level, sd_level, and volume.
examples/rhythm606_demo.py demonstrates all four presets across four classic
patterns in 56 seconds, writing wav_exports/rhythm606_demo.wav.
What it costs
examples/poly_bench.py rhythm606 benchmarks all seven voices sounding
simultaneously (struck every four buffers) across block sizes:
block |
CPython ms |
factor |
MicroPython ms |
factor |
|---|---|---|---|---|
64 |
17.80 |
1.20 |
9.44 |
2.26 |
128 (default) |
10.59 |
2.01 |
7.30 |
2.92 |
256 |
7.95 |
2.68 |
6.22 |
3.43 |
When idle, parked voices take 0.14 ms per buffer on CPython (factor 150) and 0.34 ms on MicroPython (factor 63). All seven voices running together run comfortably faster than real time on both CPython (2.01x) and MicroPython (2.92x) at the default 128-frame block.