audioJS

@audio/synth-voice

Status calibrated

npm1.2.0licenseMIT

Synth voice — osc × ADSR through envelope-scaled lowpass (Tone.js Synth class)

Overview

Install
Updated
Family
synth, 20 packages under it
Tags
make

Osc + envelope voice (Tone.js Synth class)

import 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', fc: 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
fc 3000 Lowpass cutoff at full envelope, Hz (cutoff still accepted)
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