diff --git a/packages/superdough/synth.mjs b/packages/superdough/synth.mjs index e8df980e..fef3e0d7 100644 --- a/packages/superdough/synth.mjs +++ b/packages/superdough/synth.mjs @@ -41,10 +41,19 @@ export function registerSynthSounds() { freq = Number(freq); const node = getWorklet(ac, 'better-oscillator', { frequency: freq }); + const o = ac.createOscillator(); + o.start(t); + o.onended = () => { + console.log('here'); + o.disconnect(); + node.disconnect(); + }; return { node, - stop: (time) => {}, + stop: (time) => { + o.stop(time); + }, triggerRelease: (time) => { // envGain?.stop(time); },