mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 13:48:34 +00:00
cleanup
This commit is contained in:
parent
b0bbd58f66
commit
f38d1c272e
@ -22,18 +22,12 @@ export const getEnvelope = (attack, decay, sustain, release, velocity, begin) =>
|
||||
node: gainNode,
|
||||
stop: (t) => {
|
||||
// to make sure the release won't begin before sustain is reached
|
||||
//phase = Math.max(t, phase + 0.001);
|
||||
phase = Math.max(t, phase);
|
||||
// see https://github.com/tidalcycles/strudel/issues/522
|
||||
//if (typeof gainNode.gain.cancelAndHoldAtTime === 'function') {
|
||||
// gainNode.gain.cancelAndHoldAtTime(t); // this seems to release instantly....
|
||||
// see https://discord.com/channels/779427371270275082/937365093082079272/1086053607360712735
|
||||
//} else {
|
||||
// firefox: this will glitch when the sustain has not been reached yet at the time of release
|
||||
gainNode.gain.setValueAtTime(sustainLevel, phase);
|
||||
//}
|
||||
gainNode.gain.linearRampToValueAtTime(0, phase + release); // release
|
||||
return phase + release;
|
||||
phase += release;
|
||||
gainNode.gain.linearRampToValueAtTime(0, phase); // release
|
||||
return phase;
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user