diff --git a/packages/superdough/superdough.mjs b/packages/superdough/superdough.mjs index 96cf3f673..f9e8a1b8c 100644 --- a/packages/superdough/superdough.mjs +++ b/packages/superdough/superdough.mjs @@ -346,10 +346,10 @@ function getDelay(orbit, delaytime, delayfeedback, t, channels) { export function getLfo(audioContext, begin, end, properties = {}) { const { shape = 0, ...props } = properties; const { dcoffset = -0.5, depth = 1 } = properties; - return getWorklet(audioContext, 'lfo-processor', { + const lfoprops = { frequency: 1, depth, - skew: 0, + skew: .5, phaseoffset: 0, time: begin, begin, @@ -360,7 +360,10 @@ export function getLfo(audioContext, begin, end, properties = {}) { max: dcoffset + depth * 0.5, curve: 1, ...props, - }); + } + + console.info(lfoprops) + return getWorklet(audioContext, 'lfo-processor', lfoprops); } // export function getLfo(audioContext, time, end, properties = {}) { diff --git a/packages/superdough/synth.mjs b/packages/superdough/synth.mjs index 88e14e5ab..a95ba9df4 100644 --- a/packages/superdough/synth.mjs +++ b/packages/superdough/synth.mjs @@ -279,7 +279,7 @@ export function registerSynthSounds() { getParamADSR(envGain.gain, attack, decay, sustain, release, 0, 1, begin, holdend, 'linear'); let lfo; if (pwsweep != 0) { - lfo = getLfo(ac, begin, end, { frequency: pwrate, depth: pwsweep }); + lfo = getLfo(ac, begin, end, { frequency: pwrate, depth: pwsweep, skew: .5, dcoffset: 0 }); lfo.connect(o.parameters.get('pulsewidth')); } let timeoutNode = webAudioTimeout( diff --git a/packages/superdough/worklets.mjs b/packages/superdough/worklets.mjs index c9948916a..df3c445ac 100644 --- a/packages/superdough/worklets.mjs +++ b/packages/superdough/worklets.mjs @@ -185,6 +185,8 @@ class LFOProcessor extends AudioWorkletProcessor { return true; } + + const output = outputs[0]; const frequency = parameters['frequency'][0];