audio

@audio/synth-voice1.3.0

Synth voice

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

Status
calibrated
Updated
Family
synth, 20 packages under it
Plugin
voice, instrument, whole signal, 8 parameters
Category
synthesis
Licence
MIT
Dependencies
3 packages, all permissive: MIT
Downloads
2,281 last month
Tests
94 in audiojs/synth's CI, passed at f613513,

Parameters

  • instrument
  • whole signal
type
sine, square, sawtooth, triangle
attack
0.01 s
0.001 to 2 s
decay
0.15 s
0.001 to 2 s
sustain
0.6
0 to 1
release
0.25 s
0.001 to 4 s
fc
3000 Hz
100 to 16000 Hz
envAmount
0.6
0 to 1
amp
0.7
0 to 1

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