fix: format

This commit is contained in:
Felix Roos 2024-01-03 22:17:11 +01:00
parent 83c820a18c
commit d582bbbb60

View File

@ -10,15 +10,18 @@ const setRelease = (param, phase, sustain, startTime, endTime, endValue, curve =
param[ramp](endValue, endTime); param[ramp](endValue, endTime);
} else if (param.cancelAndHoldAtTime == null) { } else if (param.cancelAndHoldAtTime == null) {
//this replicates cancelAndHoldAtTime behavior for Firefox //this replicates cancelAndHoldAtTime behavior for Firefox
setTimeout(() => { setTimeout(
//sustain at current value () => {
const currValue = param.value; //sustain at current value
param.cancelScheduledValues(0); const currValue = param.value;
param.setValueAtTime(currValue, 0); param.cancelScheduledValues(0);
param.setValueAtTime(currValue, 0);
//release //release
param[ramp](endValue, endTime); param[ramp](endValue, endTime);
}, (startTime - ctx.currentTime) * 1000); },
(startTime - ctx.currentTime) * 1000,
);
} else { } else {
//stop the envelope, hold the value, and then set the release stage //stop the envelope, hold the value, and then set the release stage
param.cancelAndHoldAtTime(startTime); param.cancelAndHoldAtTime(startTime);