@audio/synth-voice
v1.1.3
Published
Synth voice — osc × ADSR through envelope-scaled lowpass (Tone.js Synth class)
Readme
@audio/synth-voice

Osc + envelope voice (Tone.js Synth class)
npm install @audio/synth-voiceimport voice from '@audio/synth-voice'Composed voice — synth-osc through a one-pole lowpass whose cutoff is scaled by an synth-envelope ADSR, the Tone.js Synth/MonoSynth class. Pitched — (freq, opts).
voice(440, { type: 'sawtooth', cutoff: 3000, envAmount: 0.6 }) // → Float32Array| Param | Default | |
|---|---|---|
| freq | — | Hz (positional) |
| fs | 44100 | Sample rate |
| type | 'sawtooth' | Oscillator waveform — see synth-osc |
| duration | 0.6 | Note-on length, seconds |
| attack / decay / sustain / release | 0.01 / 0.15 / 0.6 / 0.25 | ADSR, seconds/level |
| cutoff | 3000 | Lowpass cutoff at full envelope, Hz |
| envAmount | 0.6 | 0..1 — how much the envelope scales the cutoff |
| amp | 0.7 | Peak amplitude |
Use when: a ready-made subtractive voice for synth-poly, without composing osc+envelope+filter by hand.
Part of @audio/synth — the synth family umbrella.
MIT © audiojs
