HISE Logo Forum
    • Categories
    • Register
    • Login

    Timed silence?

    Scheduled Pinned Locked Moved General Questions
    5 Posts 3 Posters 161 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      paper_lung
      last edited by

      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?

      DanHD 1 Reply Last reply Reply Quote 0
      • DanHD
        DanH @paper_lung
        last edited by DanH

        @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...

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

        P 1 Reply Last reply Reply Quote 0
        • P
          paper_lung @DanH
          last edited by

          @DanH Thanks! I'll take a look :)

          ulrikU 1 Reply Last reply Reply Quote 0
          • ulrikU
            ulrik @paper_lung
            last edited by

            @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);
            

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

            P 1 Reply Last reply Reply Quote 1
            • P
              paper_lung @ulrik
              last edited by

              @ulrik Perfect, thankyou for the demonstration! I'll take a look at this and have a play around.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              49

              Online

              1.7k

              Users

              11.7k

              Topics

              101.8k

              Posts