audio

@audio/synth-envelope1.1.3

ADSR envelope generator

ADSR envelope generator — gain contour for amplitude/filter modulation

Status
calibrated
Updated
Family
synth, 20 packages under it
Plugin
adsr, effect, whole signal, 4 parameters
Category
synthesis
Licence
MIT
Dependencies
none
Downloads
2,085 last month
Tests
94 in audiojs/synth's CI, passed at f613513,

Listen

// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html
audio('/samples/music/modern/local-forecast.mp3').adsr()

// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html

Parameters

  • effect
  • whole signal
attack
0.01 s
0.001 to 2 s
decay
0.1 s
0.001 to 2 s
sustain
0.7
0 to 1
release
0.3 s
0.001 to 4 s

ADSR contour generator (one-shot, known length)

import adsr from '@audio/synth-envelope'

ADSR gain-contour generator — attack/decay linear, sustain flat, release exponential-ish. Returns a Float32Array contour to multiply onto any source (gain, filter cutoff, amplitude); one-shot, whole envelope rendered up front (known total length, unlike a gate-driven realtime ADSR).

adsr({ attack: 0.01, decay: 0.1, sustain: 0.7, release: 0.3, duration: 1 })
Param Default
attack 0.01 Seconds
decay 0.1 Seconds
sustain 0.7 Sustain level, 0..1
release 0.3 Seconds
duration 1 Note-on length, seconds (release starts here)
fs 44100 Sample rate

Use when: shaping any generator's amplitude or a filter cutoff — used internally by synth-voice.


Part of @audio/synth — the synth family umbrella.

MIT © audiojs