fix: format
This commit is contained in:
parent
83c820a18c
commit
d582bbbb60
1 changed files with 11 additions and 8 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue