Some cleanup
This commit is contained in:
parent
f0669ce3ba
commit
b3537a9acb
2 changed files with 3 additions and 10 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue