added distortion effect

This commit is contained in:
Jade (Rose) Rowland 2024-02-28 14:31:07 -05:00
parent c77b0098a7
commit 1221c6144c
3 changed files with 53 additions and 8 deletions

View file

@ -311,6 +311,7 @@ export const superdough = async (value, deadline, hapDuration) => {
coarse,
crush,
shape,
distort,
pan,
vowel,
delay = 0,
@ -452,8 +453,14 @@ export const superdough = async (value, deadline, hapDuration) => {
// effects
coarse !== undefined && chain.push(getWorklet(ac, 'coarse-processor', { coarse }));
crush !== undefined && chain.push(getWorklet(ac, 'crush-processor', { crush }));
const shapeInput = Array.isArray(shape) ? { shape: shape[0], postgain: shape[1] } : { shape };
shape !== undefined && chain.push(getWorklet(ac, 'shape-processor', shapeInput));
if (shape !== undefined) {
const input = Array.isArray(shape) ? { shape: shape[0], postgain: shape[1] } : { shape };
chain.push(getWorklet(ac, 'shape-processor', input));
}
if (distort !== undefined) {
const input = Array.isArray(distort) ? { distort: distort[0], postgain: distort[1] } : { distort };
chain.push(getWorklet(ac, 'distort-processor', input));
}
compressorThreshold !== undefined &&
chain.push(