From 3daacba2c352829f583023c15cec4299b5ab8399 Mon Sep 17 00:00:00 2001 From: Karol Libardi Date: Mon, 4 Mar 2024 10:27:55 +0100 Subject: [PATCH] Added ability to mute a synth/sound after it was triggered --- packages/superdough/superdough.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/superdough/superdough.mjs b/packages/superdough/superdough.mjs index 4d67e0386..245764a67 100644 --- a/packages/superdough/superdough.mjs +++ b/packages/superdough/superdough.mjs @@ -518,6 +518,7 @@ export const superdough = async (value, deadline, hapDuration) => { // toDisconnect = all the node that should be disconnected in onended callback // this is crucial for performance toDisconnect = chain.concat([delaySend, reverbSend, analyserSend]); + return { mute: (dt) => post.gain.linearRampToValueAtTime(0, ac.currentTime + dt) }; }; export const superdoughTrigger = (t, hap, ct, cps) => superdough(hap, t - ct, hap.duration / cps, cps);