SynthSnare — Snare Drum Engine
Files
static/js/synth/engines/snare.js
Signal Path
┌──→ sine ──→ slamGain ──→ noteGain ──┐
body mix ──→ waveDefs ──┼──→ triangle ──→ slamGain ──→ noteGain ──┤
└──→ saw ──→ slamGain ──→ noteGain ──→ chain.input
│
snareMix ──→ noiseBuf ──→ bandpass ──→ ng ──→ noteGain ─────────────┤
│
crack ──→ noiseBuf ──→ cg ──→ noteGain ─────────────────────────────┘
│
filter → distortion → EQ → compressor → clarity → limiter → masterGain
Modules
| ID | Type | Description |
|---|---|---|
| Pitch | source | Body frequency + slam envelope |
| Transient | source | Snare noise + crack parameters |
| Filter | processor | Low-pass (bypassed at 20000) |
| Distortion | distortion | Waveshaper pipeline |
| EQ | source | 3-band (skipped by backward loop) |
| Compressor | processor | Dynamics compressor |
| Clarity | processor | Mud/air reduction |
| Volume | master | ADSR envelope (handled by engine.js schedule) |
| Normalize | builtin | Peak normalization |
Parameters
| Param | Range | Default | Description |
|---|---|---|---|
bodyFreq |
100–400 Hz | 220 Hz | Body oscillator start frequency |
bodySlam |
0–1 | 0.5 | Frequency slam amount |
bodyDecay |
0.03–0.5 | 0.15 | Body decay time |
bodyMix |
0–1 | 0.7 | Body level mix |
sineLevel |
0–1 | 0.4 | Sine oscillator level |
triangleLevel |
0–1 | 0.3 | Triangle oscillator level |
sawtoothLevel |
0–1 | 0 | Sawtooth oscillator level |
snareMix |
0–1 | 0.5 | Snare buzz level |
snareDecay |
0.01–0.5 | 0.15 | Snare buzz decay |
crackAmount |
0–1 | 0.2 | Crack noise amount |
crackDecay |
0.003–0.08 | 0.03 | Crack decay time |
buzzFreq |
2000–8000 Hz | 3500 Hz | Bandpass centre for snare buzz |
buzzQ |
0.5–20 | 1 | Bandpass resonance |
buzzSweep |
0–1 | 0.3 | Frequency sweep amount |
filterCut |
200–20000 Hz | 20000 | Low-pass filter cutoff |
clarity* |
— | — | See clarity module docs |
compThreshold |
–60–0 dB | –24 dB | Compressor threshold |
compRatio |
1–20 | 4 | Compressor ratio |
volAttack |
0.001–0.1 s | 0.002 | Volume attack |
volDecay |
0.05–0.8 s | 0.3 | Volume decay |
volSustain |
0–0.5 | 0.05 | Volume sustain level |
volRelease |
0.005–0.5 s | 0.05 | Volume release |
buildLiveChain
Uses the unified backward loop. Processors are wired automatically from the
modules array. chain.input is the first processor's input — trigger()
connects per-note sources here.
trigger
Creates per-note noteGain with AD envelope, then creates:
- Body oscillator(s) with frequency slam curve
- Snare noise through bandpass filter with frequency sweep
- Crack noise burst
All sources connect to noteGain which feeds chain.input.