@audio/synth-drum
v2.0.1
Published
Drum synthesis — membrane kick, metal cymbal, noise snare (Tone.js class)
Readme
@audio/synth-drum

Membrane (pitch-drop kick) / metal (inharmonic cymbal) / noiseDrum (snare/hat)
npm install @audio/synth-drumimport membrane, { metal, noiseDrum } from '@audio/synth-drum'Three drum-synthesis kernels, the Tone.js MembraneSynth/MetalSynth/NoiseSynth class: membrane is a sine whose pitch drops exponentially (kick), metal sums six inharmonic square-ish partials (cymbal — classic FM-bell ratio set), noiseDrum is decaying seeded band noise (snare/hat). membrane and metal are pitched — (freq, opts); noiseDrum is unpitched — (opts).
membrane(55, { drop: 3, duration: 0.5 }) // kick
metal(200, { duration: 0.6 }) // cymbal
noiseDrum({ duration: 0.25, seed: 9 }) // snare/hat| Param | Default | Applies to | |
|---|---|---|---|
| freq | 55 / 200 | membrane / metal | Hz (positional) |
| drop | 3 | membrane | pitch-drop multiplier |
| duration | 0.5 / 0.6 / 0.25 | all | seconds |
| amp | 0.9 / 0.5 / 0.7 | all | peak amplitude |
| seed | 9 | noiseDrum | PRNG seed |
| fs | 44100 | all | sample rate |
Use when: synthetic drum hits — membrane for kicks, metal for cymbals/bells, noiseDrum for snare/hat layers.
Part of @audio/synth — the synth family umbrella.
MIT © audiojs
