Codeformat and pure worklet calls

This commit is contained in:
Aria
2025-09-23 11:55:27 -05:00
parent bb0ea3b4ad
commit 93a38003ed
4 changed files with 12 additions and 9 deletions
+2
View File
@@ -3581,3 +3581,5 @@ Pattern.prototype.worklet = function (src, ...inputs) {
});
});
};
export const worklet = (...args) => pure(0).worklet(...args);
+1 -1
View File
@@ -344,7 +344,7 @@ export async function onTriggerSample(t, value, onended, bank, resolveUrl) {
bufferSource.disconnect();
vibratoOscillator?.stop();
node.disconnect();
}
};
const handle = { node: out, cleanup };
// cut groups
+5 -4
View File
@@ -394,7 +394,8 @@ function getPhaser(time, end, frequency = 1, depth = 0.5, centerFrequency = 1000
const numStages = 8; // num of filters in series
let fOffset = 0;
const filterChain = [];
const fMin = centerFrequency * 0.5, fMax = centerFrequency;
const fMin = centerFrequency * 0.5,
fMax = centerFrequency;
const ratio = Math.pow(fMax / fMin, 1 / numStages);
for (let i = 0; i < numStages; i++) {
const filter = ac.createBiquadFilter();
@@ -860,7 +861,7 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
cleanup = () => {
phaserFX.disconnect();
dry.disconnect();
}
};
chain.push({ input: dry, output: mix, cleanup });
}
if (fx.workletSrc !== undefined) {
@@ -889,7 +890,7 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
delayNode.disconnect();
dry.disconnect();
wetDelay.disconnect();
}
};
chain.push({ input: dry, output: sum, cleanup });
}
// reverb
@@ -925,7 +926,7 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
reverbNode.disconnect();
dry.disconnect();
wetReverb.disconnect();
}
};
chain.push({ input: dry, output: sum, cleanup });
}
}
+4 -4
View File
@@ -185,7 +185,7 @@ export function registerSynthSounds() {
destroyAudioWorkletNode(o);
fm?.stop();
vibratoOscillator?.stop();
}
};
return {
node,
cleanup,
@@ -250,7 +250,7 @@ export function registerSynthSounds() {
const cleanup = () => {
destroyAudioWorkletNode(o);
}
};
return {
node,
@@ -318,7 +318,7 @@ export function registerSynthSounds() {
destroyAudioWorkletNode(lfo);
fm?.stop();
vibratoOscillator?.stop();
}
};
return {
node,
cleanup,
@@ -356,7 +356,7 @@ export function registerSynthSounds() {
const cleanup = () => {
g.disconnect();
o.disconnect();
}
};
return {
node,
cleanup,