mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 05:28:41 +00:00
replace odd envelope
This commit is contained in:
parent
5be7898522
commit
4319df0cb6
@ -74,11 +74,8 @@ export function createFilter(context, type, frequency, Q, attack, decay, sustain
|
|||||||
|
|
||||||
// Apply ADSR to filter frequency
|
// Apply ADSR to filter frequency
|
||||||
if (fenvmod > 0) {
|
if (fenvmod > 0) {
|
||||||
const sustainFreq = sustain * frequency;
|
const gainNode = getADSR(attack, decay, sustain, release, fenvmod, t, t + attack + decay + release);
|
||||||
filter.frequency.linearRampToValueAtTime(frequency * fenvmod, t + attack);
|
gainNode.connect(filter.frequency);
|
||||||
filter.frequency.linearRampToValueAtTime(sustainFreq, t + attack + decay);
|
|
||||||
filter.frequency.setValueAtTime(sustainFreq, end);
|
|
||||||
filter.frequency.linearRampToValueAtTime(frequency, end + release);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return filter;
|
return filter;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user