HISE Logo Forum
    • Categories
    • Register
    • Login

    Link Delay Times

    Scheduled Pinned Locked Moved General Questions
    5 Posts 2 Posters 237 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.
    • DanHD
      DanH
      last edited by

      Hi guys, could anyone recommend a script to link the L/R Delay times via a button, I was hoping to slot in the example from the HISE General UI (Link Sliders) but it doesn't appear to work! Here's my current script:

      //DELAY LINK - NOT WORKING

      reg i;

      const var fx = [];
      fx[0] = Synth.getEffect("Delay1");
      fx[1] = Synth.getEffect("Delay1");

      const var btnLink = Content.getComponent("DELAYLINK");

      const var knobs = [];
      knobs[0] = Content.getComponent("DELAYTIME_L");
      knobs[1] = Content.getComponent("DELAYTIME_R");

      knobs[0].setControlCallback(knobCB);
      knobs[1].setControlCallback(knobCB);

      inline function knobCB(control, value)
      {
      local idx = knobs.indexOf(control);

      if (btnLink.getValue() == 0) // Controls not linked
      {
          fx[idx].setAttribute(2, value);
          fx[idx].setAttribute(3, value);
      
      }
      else 
      {
          for (i = 0; i < knobs.length; i++)
          {
              fx[i].setAttribute(2, value);
              fx[i].setAttribute(3, value);
              knobs[i].setValue(value);
          }
      }
      

      }

      Many thanks in advance

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

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @DanH
        last edited by

        @DanH said in Link Delay Times:

        Hi guys, could anyone recommend a script to link the L/R Delay times via a button, I was hoping to slot in the example from the HISE General UI (Link Sliders) but it doesn't appear to work! Here's my current script:

        //DELAY LINK - NOT WORKING
         
         reg i;    //<--- no need to declare this if its just used in a for loop
         
        const var fx = [];  // <--- shouldn't set this to a const and then put something in it later.....
        fx[0] = Synth.getEffect("Delay1");   // <-- like this
        fx[1] = Synth.getEffect("Delay1");
        
        const var btnLink = Content.getComponent("DELAYLINK");
         
        const var knobs = [];    //<-- again not constant....
        knobs[0] = Content.getComponent("DELAYTIME_L");
        knobs[1] = Content.getComponent("DELAYTIME_R");
        
        knobs[0].setControlCallback(knobCB);
        knobs[1].setControlCallback(knobCB);
         
        inline function knobCB(control, value)   
        {
            local idx = knobs.indexOf(control);
            
            if (btnLink.getValue() == 0) // Controls not linked
            {
                fx[idx].setAttribute(2, value);   //<-- better using the constant names not the index numbers - more readable
                fx[idx].setAttribute(3, value);
            
            }else{
                for (i = 0; i < knobs.length; i++)
                {
                    fx[i].setAttribute(2, value);
                    fx[i].setAttribute(3, value);
                    knobs[i].setValue(value);    //<-- so you changed them but didnt ask them to do anything
                    knobs[i].changed();  //<-- so add this line....
        
                }
            }
                
        }
        

        Many thanks in advance

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon Thanks mate :)

          So I've copied in your script and changed the 2 x 'const var' to just 'var' that you recommended... Should it be working? (It's not). Please let me know anything else I shld be doing...

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

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @DanH
            last edited by Lindon

            @DanH try debugging it....

            add some Console.print statements to see what is working and what isnt...

            you may find this is where at least some of your problems are:

            fx[0] = Synth.getEffect("Delay1");   // <-- the first delay you want to change
            fx[1] = Synth.getEffect("Delay1");     // <-- wot? the first delay again???
            

            HISE Development for hire.
            www.channelrobot.com

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

              @Lindon Thanks for he help! So the two knobs were still linked to the delay parameters, once I removed it worked fine! Doh.

              Just saw the updated message and if I remove the second 'fx[1]' line the knobs don't move together, so I've left it as was as seems to work that way.

              Thanks again :)

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

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

              46

              Online

              1.7k

              Users

              11.7k

              Topics

              101.8k

              Posts