Some cleanup

This commit is contained in:
Aria
2025-09-24 22:17:30 -07:00
parent f0669ce3ba
commit b3537a9acb
2 changed files with 3 additions and 10 deletions
+2 -9
View File
@@ -398,16 +398,9 @@ export const getDistortionAlgorithm = (algo) => {
}
}
const name = _algoNames[index % _algoNames.length]; // allow for wrapping if algo was a number
const algorithm = distortionAlgorithms[name];
return { algorithm, index };
return distortionAlgorithms[name];
};
export const getDistortion = (distort, postgain, algorithm) => {
const { index } = getDistortionAlgorithm(algorithm);
return getWorklet(
getAudioContext(),
'distort-processor',
{ distort, postgain },
{ processorOptions: { algorithm: index } },
);
return getWorklet(getAudioContext(), 'distort-processor', { distort, postgain }, { processorOptions: { algorithm } });
};
+1 -1
View File
@@ -354,7 +354,7 @@ class DistortProcessor extends AudioWorkletProcessor {
constructor({ processorOptions }) {
super();
this.started = false;
this.algorithm = getDistortionAlgorithm(processorOptions.algorithm).algorithm;
this.algorithm = getDistortionAlgorithm(processorOptions.algorithm);
}
process(inputs, outputs, parameters) {