mirror of
https://codeberg.org/uzu/strudel
synced 2026-10-03 16:17:03 -04:00
Codeformat and pure worklet calls
This commit is contained in:
@@ -3581,3 +3581,5 @@ Pattern.prototype.worklet = function (src, ...inputs) {
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const worklet = (...args) => pure(0).worklet(...args);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user