mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 14:26:58 -04:00
[perf] fix phaser leak of unused biquads
This commit is contained in:
@@ -290,7 +290,7 @@ function getPhaser(time, end, frequency = 1, depth = 0.5, centerFrequency = 1000
|
||||
const lfo = getLfo(ac, time, end, { frequency, depth: sweep * 2 });
|
||||
|
||||
//filters
|
||||
const numStages = 2; //num of filters in series
|
||||
const numStages = 1; //num of filters in series
|
||||
let fOffset = 0;
|
||||
const filterChain = [];
|
||||
for (let i = 0; i < numStages; i++) {
|
||||
@@ -302,12 +302,9 @@ function getPhaser(time, end, frequency = 1, depth = 0.5, centerFrequency = 1000
|
||||
|
||||
lfo.connect(filter.detune);
|
||||
fOffset += 282;
|
||||
if (i > 0) {
|
||||
filterChain[i - 1].connect(filter);
|
||||
}
|
||||
filterChain.push(filter);
|
||||
}
|
||||
return { phaser: filterChain[filterChain.length - 1], lfo };
|
||||
return { phaser: filterChain, lfo };
|
||||
}
|
||||
|
||||
function getFilterType(ftype) {
|
||||
@@ -699,7 +696,7 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
|
||||
if (phaserrate !== undefined && phaserdepth > 0) {
|
||||
const { phaser, lfo } = getPhaser(t, endWithRelease, phaserrate, phaserdepth, phasercenter, phasersweep);
|
||||
audioNodes.push(lfo);
|
||||
chain.push(phaser);
|
||||
Array.prototype.push.apply(chain, phaser);
|
||||
}
|
||||
|
||||
// last gain
|
||||
|
||||
Reference in New Issue
Block a user