mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-23 21:47:16 -04:00
fix: exp envelope allow 0 without blowup
This commit is contained in:
@@ -40,6 +40,8 @@ export const getEnvelope = (attack, decay, sustain, release, velocity, begin) =>
|
||||
};
|
||||
|
||||
export const getExpEnvelope = (attack, decay, sustain, release, velocity, begin) => {
|
||||
sustain = Math.max(0.001, sustain);
|
||||
velocity = Math.max(0.001, velocity);
|
||||
const gainNode = getAudioContext().createGain();
|
||||
gainNode.gain.setValueAtTime(0.0001, begin);
|
||||
gainNode.gain.exponentialRampToValueAtTime(velocity, begin + attack);
|
||||
|
||||
Reference in New Issue
Block a user