mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 14:26:58 -04:00
Some cleanup
This commit is contained in:
@@ -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 } });
|
||||
};
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user