@maruaudio/dsp/spectral/vocoder is a clean-room channel vocoder. A logarithmic bank of 8, 12 or 16 second-order band-pass filters analyses the modulator; each band's rectified output drives a one-pole envelope (attack or release chosen per sample), which scales the matching band of the carrier. Band centres are spaced geometrically from the minimum to the maximum frequency and Q is interpolated from start to end across the bank. The wet sum is scaled by dbToGain(gainDb) × 2 / bands and mixed with the carrier through the shared equal-power pair. Filter state and coefficients are f32.
Parameters
| Path | Setter | Range as coded | Default | Unit |
|---|---|---|---|---|
bands | setVocoderNodeBandCount | Rounded, then 8 (≤ 8), 12 (≤ 12) or 16 | 12 | bands |
| carrier range | setVocoderNodeCarrierRange | min 20 to 0.45 × rate; max from min to 0.45 × rate | 120 to 12000 | Hz |
| modulator range | setVocoderNodeModulatorRange | Same | 120 to 12000 | Hz |
| Q | setVocoderNodeQ(start, end) | Each 0.25 to 40 | 4 to 8 | Q |
| envelope | setVocoderNodeEnvelope(attackMs, releaseMs) | Attack 0.1 to 2000, release 0.1 to 5000 | 8, 80 | ms |
| output | setVocoderNodeOutput(gainDb, mix) | Gain −48 to +24 dB; mix 0 to 1 | 0 dB, 1 | dB, fraction |
sourceMode | setVocoderNodeSource | Rounded, 0..4: external, self, white, pink, brown | 0 | index |
Lifecycle
initVocoderNode(sampleRate) preallocates sixteen-band state and cooks the default bank → setters → updateVocoderNodeCoefficients after any band, range, Q or envelope change → vocoderNodeTick(state, carrier, modulator) per sample, or processVocoderBlock over a block → resetVocoderNode, which clears the recurrences, envelopes and noise state and keeps the cooked bank. An optional VocoderVoicingState (initVocoderVoicing, vocoderNodeTickVoiced, updateVocoderNodeSynthesisQ) adds per-band weights, an envelope freeze, a fourth-order cascade and an even-minus-odd side output.
When to use it
Imposing the spectral envelope of a voice or drum part on a synth carrier. Self mode analyses the carrier itself; the noise modes analyse internal white, pink or brown noise. The Vocoder module uses it.
Limits
- Mono sample tick with two inputs. Coefficients change only when updated, with no smoothing.
- In the noise modes the noise replaces the modulator (analysis) input; the carrier stays the external carrier.
- At unit settings the voiced tick is bit-identical to the plain tick.