HISE Logo Forum
    • Categories
    • Register
    • Login

    Assign to delay bug

    Scheduled Pinned Locked Moved Bug Reports
    5 Posts 2 Posters 1.4k 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.
    • C
      CMG
      last edited by

      If I assign a dial to the delay it just hides the entire interface - looks like it throws up some incorrect code.
      I'm following the video tutorial, I add the reverb dial, all is well, then I add a delay mix dial and - things just die on me.

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Have you looked at the code it generates in both the onInit callback and the onControl callback?

        It's supposed to be quite error-prone, but maybe something's messing up the regex processing.

        If you paste the code (Right click in the code Editor -> Save Script to Clipboard) here, I'll take a look.

        1 Reply Last reply Reply Quote 0
        • C
          CMG
          last edited by

          Certainly here it is - this is what is generated by using the right click create method, and then the right click assign modulator parameters method.

          ON INIT -

          Content.makeFrontInterface(500,300);

          const var Reverb = Content.addKnob("Reverb", 50, 38);

          const var Delay = Content.addKnob("Delay", 187, 36);

          const var SimpleReverb = Synth.getEffect("Simple Reverb");

          const var Delay = Synth.getEffect("Delay");

          -----------------------------------_

          ON UI -

          function onControl(number, value)
          {

          switch(number)
          {
          	case Reverb:
          	{
          		SimpleReverb.setAttribute(SimpleReverb.WetLevel, value);
          		break;
          	}
          	case Delay:
          	{
          		Delay.setAttribute(Delay.Mix, value);
          		break;
          	}
          };
          

          }

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by Christoph Hart

            The knob and the delay effect have the same variable name Delay. This is not allowed, so you have to change one of the variable names:

            Content.makeFrontInterface(500,300);
            
            const var Reverb = Content.addKnob("Reverb", 50, 38);
            
            const var DelayKnob = Content.addKnob("DelayKnob", 187, 36);
            
            const var SimpleReverb = Synth.getEffect("Simple Reverb");
            
            const var Delay = Synth.getEffect("Delay");
            
            function onControl(number, value)
            {
            
            switch(number)
            {
            	case Reverb:
            	{
            		SimpleReverb.setAttribute(SimpleReverb.WetLevel, value);
            		break;
            	}
            	case DelayKnob: // <= Also change the name here!
            	{
            		Delay.setAttribute(Delay.Mix, value);
            		break;
            	}
            };
            }
            

            I'll add some test code that spits out a warning for this case, but it's pretty important to understand what the auto generated script code does - it is supposed to save you time but not relieve you of the burden of knowing Javascript :)

            There's a blog post about this very subject in case you missed it:

            http://178.62.82.76:4567/topic/74/how-to-control-modules-with-scripts

            1 Reply Last reply Reply Quote 0
            • C
              CMG
              last edited by

              Thats awesome. Makes perfect sense now that the knowledge is there. : ) as with most things.

              Thanks again

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

              34

              Online

              1.8k

              Users

              12.0k

              Topics

              104.7k

              Posts