Timed silence?
-
Hi all, I'm looking to include a demo version of my products which would introduce a 5 second silence once every 30 seconds or so. Can anyone point me in the right direction on how to achieve this?
-
@paper_lung a simple gain module set to -100 and a couple of timers in your script which turn it on and off when you want it to. Do you subscribe to @d-healey 's patreon? Pretty sure he has this covered in there somewhere...
-
@DanH Thanks! I'll take a look :)
-
@paper_lung something like this:
const MUTEGAIN = Synth.getEffect("MUTEGAIN"); const t = Engine.createTimerObject(); t.setTimerCallback(function() { var up = this.getMilliSecondsSinceCounterReset(); if (up > 30000) MUTEGAIN.setAttribute(MUTEGAIN.Gain, -100); else MUTEGAIN.setAttribute(MUTEGAIN.Gain, 0); if (up > 35000) this.resetCounter(); }); // IF DEMO inline function onDemoBtnControl(component, value) { if (value) t.startTimer(1000); else { t.stopTimer(); MUTEGAIN.setAttribute(MUTEGAIN.Gain, 0); } }; Content.getComponent("DemoBtn").setControlCallback(onDemoBtnControl);
-
@ulrik Perfect, thankyou for the demonstration! I'll take a look at this and have a play around.