From ccf2a6de52c7a595188c3404e82735f50bb5ed85 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Sun, 20 Jul 2025 23:38:16 -0400 Subject: [PATCH] fixing.. --- packages/superdough/superdough.mjs | 54 +++++++++++++++--------------- packages/superdough/worklets.mjs | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/superdough/superdough.mjs b/packages/superdough/superdough.mjs index a591df0fe..96cf3f673 100644 --- a/packages/superdough/superdough.mjs +++ b/packages/superdough/superdough.mjs @@ -343,41 +343,41 @@ function getDelay(orbit, delaytime, delayfeedback, t, channels) { return delays[orbit]; } -// export function getLfo(audioContext, begin, end, properties = {}) { -// const { shape = 0, ...props } = properties; -// const { dcoffset = -0.5, depth = 1 } = properties; -// return getWorklet(audioContext, 'lfo-processor', { -// frequency: 1, -// depth, -// skew: 0, -// phaseoffset: 0, -// time: begin, -// begin, -// end, -// shape: getModulationShapeInput(shape), -// dcoffset, -// min: dcoffset - depth * 0.5, -// max: dcoffset + depth * 0.5, -// curve: 1, -// ...props, -// }); -// } - -export function getLfo(audioContext, time, end, properties = {}) { +export function getLfo(audioContext, begin, end, properties = {}) { + const { shape = 0, ...props } = properties; + const { dcoffset = -0.5, depth = 1 } = properties; return getWorklet(audioContext, 'lfo-processor', { frequency: 1, - depth: 1, + depth, skew: 0, phaseoffset: 0, - time, - begin: time, + time: begin, + begin, end, - shape: 1, - dcoffset: -0.5, - ...properties, + shape: getModulationShapeInput(shape), + dcoffset, + min: dcoffset - depth * 0.5, + max: dcoffset + depth * 0.5, + curve: 1, + ...props, }); } +// export function getLfo(audioContext, time, end, properties = {}) { +// return getWorklet(audioContext, 'lfo-processor', { +// frequency: 1, +// depth: 1, +// skew: 0, +// phaseoffset: 0, +// time, +// begin: time, +// end, +// shape: 1, +// dcoffset: -0.5, +// ...properties, +// }); +// } + export function getSyncedLfo(audioContext, time, end, cps, cycle, properties = {}) { const frequency = cycle / cps; diff --git a/packages/superdough/worklets.mjs b/packages/superdough/worklets.mjs index 25dae03cd..c9948916a 100644 --- a/packages/superdough/worklets.mjs +++ b/packages/superdough/worklets.mjs @@ -144,7 +144,7 @@ function getParamValue(block, param) { // } // } // registerProcessor('lfo-processor', LFOProcessor); -// const waveShapeNames = Object.keys(waveshapes); +const waveShapeNames = Object.keys(waveshapes); class LFOProcessor extends AudioWorkletProcessor { static get parameterDescriptors() { return [