SynthHihat — Hi-Hat Engine
Files
static/js/synth/engines/hihat.js
Signal Path
noiseMix ──→ noiseBuf ──→ highpass (highCut) ──→ ng ──→ noteGain ──┐
│
metalMix ──→ noiseBuf ──→ bandpass (metalFreq, metalQ) ──→ mg ──→ noteGain ──→ chain.input
│
filter → distortion → EQ → compressor → clarity → limiter → masterGain
Modules
| ID | Type | Description |
|---|---|---|
| Noise | source | Noise mix + decay params |
| Metallic | source | Ring modulation params (freq, Q, mix, decay) |
| Filter | processor | High-pass (note: HPF, not LPF like other engines) |
| Distortion | distortion | Waveshaper pipeline |
| EQ | source | 3-band EQ |
| Compressor | processor | Dynamics compressor |
| Clarity | processor | Mud/air reduction |
| Volume | master | ADSR envelope |
| Normalize | builtin | Peak normalization |
Parameters
| Param | Range | Default | Description |
|---|---|---|---|
noiseMix |
0–1 | 0.8 | Main noise level |
noiseDecay |
0.01–0.5 s | 0.08 | Noise decay time |
highCut |
2000–20000 Hz | 7000 Hz | High-pass cutoff for main noise |
metalMix |
0–1 | 0.4 | Metallic ring level |
metalDecay |
0.01–0.5 s | 0.06 | Metallic ring decay |
metalFreq |
2000–12000 Hz | 6000 Hz | Bandpass centre for metallic ring |
metalQ |
0.5–20 | 5 | Bandpass resonance (ring intensity) |
filterCut |
200–20000 Hz | 6000 Hz | High-pass filter cutoff |
clarity* |
— | — | See clarity module docs |
compThreshold |
–60–0 dB | –12 dB | Compressor threshold |
compRatio |
1–20 | 6 | Compressor ratio |
volAttack |
0.001–0.02 s | 0.001 | Volume attack |
volDecay |
0.01–0.3 s | 0.06 | Volume decay |
volSustain |
0–0.3 | 0 | Volume sustain |
volRelease |
0.005–0.2 s | 0.01 | Volume release |
Differences from Other Engines
- Filter is high-pass (not low-pass). Used to cut low rumble from the noise.
filterCutdefault is 6000 Hz (not 20000). Hi-hat sound inherently cuts lows.- Compressor is more aggressive (threshold –12 dB, ratio 6:1) to tame transient spikes.
- Two separate noise sources — one for the main hi-hat sound, one for the metallic ring.
buildLiveChain
Uses the unified backward loop. The filter module's inline build creates a high-pass BiquadFilter (not low-pass).
trigger
Creates per-note noteGain with AD envelope, then creates:
- Main noise through high-pass filter (cutoff = highCut)
- Metallic ring noise through resonant bandpass (frequency = metalFreq, Q = metalQ)
Both noise sources hit noteGain which feeds chain.input.
Key Design
The main noise provides the broad "chch" hi-hat sound, while the metallic
ring adds a tuned resonant layer that gives the hat its character and pitch.
The separate highCut filter on the main noise (different from filterCut
in the processor chain) lets you shape the noise independently before it
hits the main processor chain.