@maruaudio/dsp/voices/drum-kit-model is plain data for a ten-voice drum kit: voice ids, General MIDI notes, labels, families, choke groups, levels and pad order, shared by drum instruments, sequencers and their faces without depending on one product. It renders no audio.
Parameters
There are no setters. DRUM_KIT holds, per voice:
| Id | Note | Family | Choke | Level |
|---|---|---|---|---|
kick | 36 | kick | — | 1 |
snare | 38 | snare | — | 0.82 |
rim | 40 | snare | — | 0.6 |
clap | 39 | clap | — | 0.68 |
tomLow | 41 | tom | — | 0.78 |
tomMid | 45 | tom | — | 0.74 |
hatClosed | 42 | hat | hat | 0.5 |
hatOpen | 46 | hat | hat | 0.5 |
cymbal | 49 | cymbal | — | 0.46 |
cowbell | 56 | perc | — | 0.44 |
DRUM_PAD_ORDER lists the pads clap, rim, closed hat, open hat, cymbal, kick, snare, low tom, mid tom, cowbell. DRUM_STEP_COUNT is 16, the sixteenths of a 4/4 bar.
Lifecycle
None. Two lookup maps are built when the module loads. drumVoiceForNote(note) rounds the note and returns the voice or null; drumVoiceById(id) returns the voice or null; drumVoicesChokedBy(id) lists the other voices in the same choke group.
When to use it
A drum instrument, step sequencer or pad face that should agree with the others on which note is which drum and which hats choke each other.
Limits
drumVoicesChokedBybuilds a new array on each call, and the lookups useMap; call them from control code, not from a realtime callback.- Ten fixed voices; the data is read-only.