HISE Logo Forum
    • Categories
    • Register
    • Login

    I got a bug report for my plugin from a tester

    Scheduled Pinned Locked Moved Unsolved General Questions
    23 Posts 7 Posters 1.2k 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.
    • StraticahS
      Straticah
      last edited by

      My granular delay plugin seems to have a slider issue, i am using sliders which all can be in synced an unsynced modes. Here is the feedback i got:

      1. When I save my FL Studio project where the plugin was used and reopen it again, the left and right delay time is always set to 0 (this bug is only visual, the actual parameters seem to be saved properly), but when I close this instance of the plugin and open it again all those numbers are getting back to the correct saved ones.

      any idea where i should start searching in my code?

      ? A 2 Replies Last reply Reply Quote 0
      • ?
        A Former User @Straticah
        last edited by

        @Straticah are the displayed values using the default knob value popup? or are they seperate labels/panels?

        StraticahS 1 Reply Last reply Reply Quote 1
        • A
          aaronventure @Straticah
          last edited by aaronventure

          @Straticah Is it only the delay time sliders? Are these the same components as other sliders i.e. they're not ScriptPanels?

          What do you do differently for these components? Any special stuff happening in the callback?

          FL Studio has a free trial, have you downloaded it to check if you can reproduce the issue?

          Are you using look and feel or paint routine for these controls? If so, are you setting the value somewhere and not calling sendRepaintMessage() / repaintImmediately() after doing so (because reopening the GUI redraws the entire GUI and results in the correct display)?

          StraticahS 1 Reply Last reply Reply Quote 0
          • StraticahS
            Straticah @A Former User
            last edited by

            @iamlamprey i am using the default one inside a LAF knob. I am not drawing the value separate.

            1 Reply Last reply Reply Quote 0
            • StraticahS
              Straticah @aaronventure
              last edited by Straticah

              @aaronventure

              "Are you using look and feel or paint routine for these controls? If so, are you setting the value somewhere and not calling sendRepaintMessage() / repaintImmediately() after doing so (because reopening the GUI redraws the entire GUI and results in the correct display)?"

              This could be it i will check that!

              only thing i do differently is that i have two states/ranges. One goes the whole ms and the other one is 0-18 to make use of the time divisions.

              I assume its just missing a repaint for the LAF part - hope thats it, will check :)

              
              //2
              
              //Sync Unsync Button
              const var SYNC2 = Content.getComponent("Buttonsync1");
              const var Knob7 = Content.getComponent("Knob7");
              const var Knob8 = Content.getComponent("Knob8");
              
              Content.setPropertiesFromJSON("Knob7", {
                "mode": "TempoSync",
                "stepSize": 1,
              });
              
              Content.setPropertiesFromJSON("Knob8", {
                "mode": "TempoSync",
                "stepSize": 1,
              });
              
              
              inline function onKnob7Control(component, value)
              {
                  GRAINS.setAttribute(GRAINS.SpeedL, value);
              }
              Content.getComponent("Knob7").setControlCallback(onKnob7Control);
              
              inline function onKnob8Control(component, value)
              {
                  GRAINS.setAttribute(GRAINS.SpeedR, value);
              }
              Content.getComponent("Knob8").setControlCallback(onKnob8Control);
              
              
              
              inline function onSYNC2Control(component, value)
              {
                GRAINS.setAttribute(GRAINS.TempoSync, value);
                
              	if(value)
              	{
              		// Switch the knob to tempo sync mode
              		Knob7.set("mode", "TempoSync");
              		Knob7.set("min", 0);
              		Knob7.set("max", 18);
              		Knob7.set("stepSize", 1);
              		//Knob4.set("middlePosition", 250);
              		
              		// Switch the knob to tempo sync mode
              		Knob8.set("mode", "TempoSync");
              		Knob8.set("min", 0);
              		Knob8.set("max", 18);
              		Knob8.set("stepSize", 1);
              		//Knob4.set("middlePosition", 250);
              
              	}
              	else
              	{
              		// Switch the knob to frequency mode
              		Knob7.set("mode", "Time");
              		Knob7.set("min", 0);
              		Knob7.set("max", 1000);
              		Knob7.set("middlePosition", 500);
              		Knob7.set("stepSize", 1);
              		
              		// Switch the knob to frequency mode
              		Knob8.set("mode", "Time");
              		Knob8.set("min", 0);
              		Knob8.set("max", 1000);
              		Knob8.set("middlePosition", 500);
              		Knob8.set("stepSize", 1);
              
              	}
              	
              Knob7.setValue(GRAINS.getAttribute(GRAINS.SpeedL));
              Knob8.setValue(GRAINS.getAttribute(GRAINS.SpeedR));
              	
              }
              
              Content.getComponent("Buttonsync1").setControlCallback(onSYNC2Control);
              
              
              
              StraticahS 1 Reply Last reply Reply Quote 0
              • StraticahS
                Straticah @Straticah
                last edited by Straticah

                @aaronventure @iamlamprey just checked its all sliders that use the sync/unsync script i showed above. Would i do a repaint for the whole UI or based on the sliders and how do i do that best in this scenario?

                ? A 2 Replies Last reply Reply Quote 0
                • ?
                  A Former User @Straticah
                  last edited by

                  @Straticah if the SYNC2 switch(es) are saved in preset, i think you could just do something like this:

                  	}
                  	
                  Knob7.setValue(GRAINS.getAttribute(GRAINS.SpeedL));
                  Knob8.setValue(GRAINS.getAttribute(GRAINS.SpeedR));
                  
                  Knob7.repaint();
                  Knob8.repaint();
                  	
                  }
                  

                  and it should be fine, if that doesn't repaint use .repaintImmediately() to make it asynchronous

                  StraticahS 1 Reply Last reply Reply Quote 1
                  • StraticahS
                    Straticah @A Former User
                    last edited by

                    @iamlamprey its giving me "function not found" anything that i might be missing?

                    oskarshO 1 Reply Last reply Reply Quote 0
                    • A
                      aaronventure @Straticah
                      last edited by

                      @Straticah just call the correct method (repaintImmediately() for panels and sendRepaintMessage() for everything else) for each component that you're setting the value to.

                      When changing the component value in any way other than the control callback, LAF or Paint routine won't update itself manually.

                      So you either have to call repaint or you call control.changed(), which also executes the callbacks of these controls.

                      in your example, you seem to be missing these calls after setting Knob7 and Knob8 values. So just call it there

                      Knob7.sendRepaintMessage()
                      Knob8.sendRepaintMessage()

                      ? StraticahS 2 Replies Last reply Reply Quote 1
                      • ?
                        A Former User @aaronventure
                        last edited by

                        @Straticah yep sorry, it's sendRepaintMessage()

                        Knob7.sendRepaintMessage()
                        Knob8.sendRepaintMessage()

                        1 Reply Last reply Reply Quote 1
                        • oskarshO
                          oskarsh @Straticah
                          last edited by

                          @Straticah I get the same bug using the HISE default delay as well. Everytime I recompile the sliders are reset to 0

                          It's probably a Hise bug and I can recommend running your own scriptnode delay

                          StraticahS 1 Reply Last reply Reply Quote 0
                          • StraticahS
                            Straticah @oskarsh
                            last edited by

                            @oskarsh ah good to know, but in fact i am already using a custom made ping pong feedback delay that i made in scriptnode. The sliders are connected to the tempo sync node and an input toggle.

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @Straticah
                              last edited by

                              @Straticah are the sliders set to save in preset?

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public HISE tutorials

                              StraticahS 1 Reply Last reply Reply Quote 0
                              • StraticahS
                                Straticah @d.healey
                                last edited by Straticah

                                @d-healey they are, since they can have two modes that are overwritten by the script do i need to set saving in preset inside the script aswell? -and if so how

                                I just saw that this bug only apperas on one of the two modes.

                                Currently i just select the element and enable save in preset within HISE.

                                StraticahS 1 Reply Last reply Reply Quote 0
                                • StraticahS
                                  Straticah @Straticah
                                  last edited by Straticah

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • StraticahS Straticah marked this topic as a question on
                                  • StraticahS
                                    Straticah @aaronventure
                                    last edited by Straticah

                                    @aaronventure this worked just fine, unfortunately it did not fix the problem.

                                    On startup it still shows 0 as the delay slider value when saved in a project.

                                    It appears to be only for the unsynced state (time in ms) value tho.

                                    fcc516f1-fe18-44d5-9a8b-9885f265d29f-image.png

                                    //2
                                    
                                    //Sync Unsync Button
                                    const var SYNC2 = Content.getComponent("Buttonsync1");
                                    const var Knob7 = Content.getComponent("Knob7");
                                    const var Knob8 = Content.getComponent("Knob8");
                                    
                                    Content.setPropertiesFromJSON("Knob7", {
                                      "mode": "TempoSync",
                                      "stepSize": 1,
                                    });
                                    
                                    Content.setPropertiesFromJSON("Knob8", {
                                      "mode": "TempoSync",
                                      "stepSize": 1,
                                    });
                                    
                                    
                                    inline function onKnob7Control(component, value)
                                    {
                                        GRAINS.setAttribute(GRAINS.SpeedL, value);
                                    }
                                    Content.getComponent("Knob7").setControlCallback(onKnob7Control);
                                    
                                    inline function onKnob8Control(component, value)
                                    {
                                        GRAINS.setAttribute(GRAINS.SpeedR, value);
                                    }
                                    Content.getComponent("Knob8").setControlCallback(onKnob8Control);
                                    
                                    
                                    
                                    inline function onSYNC2Control(component, value)
                                    {
                                      GRAINS.setAttribute(GRAINS.Delay_Sync, value);
                                      
                                    	if(value)
                                    	{
                                    		// Switch the knob to tempo sync mode
                                    		Knob7.set("mode", "TempoSync");
                                    		Knob7.set("min", 0);
                                    		Knob7.set("max", 1000);
                                    		Knob7.set("stepSize", 1);
                                    		//Knob4.set("middlePosition", 250);
                                    		
                                    		// Switch the knob to tempo sync mode
                                    		Knob8.set("mode", "TempoSync");
                                    		Knob8.set("min", 0);
                                    		Knob8.set("max", 1000);
                                    		Knob8.set("stepSize", 1);
                                    		//Knob4.set("middlePosition", 250);
                                    
                                    	}
                                    	else
                                    	{
                                    		// Switch the knob to frequency mode
                                    		Knob7.set("mode", "Time");
                                    		Knob7.set("min", 0);
                                    		Knob7.set("max", 1000);
                                    		Knob7.set("middlePosition", 500);
                                    		Knob7.set("stepSize", 1);
                                    		
                                    		// Switch the knob to frequency mode
                                    		Knob8.set("mode", "Time");
                                    		Knob8.set("min", 0);
                                    		Knob8.set("max", 1000);
                                    		Knob8.set("middlePosition", 500);
                                    		Knob8.set("stepSize", 1);
                                    
                                    	}
                                    	
                                    Knob7.setValue(GRAINS.getAttribute(GRAINS.SpeedL));
                                    Knob8.setValue(GRAINS.getAttribute(GRAINS.SpeedR));
                                    
                                    
                                    Knob7.sendRepaintMessage();
                                    Knob8.sendRepaintMessage();
                                    
                                    
                                    }
                                    
                                    Content.getComponent("Buttonsync1").setControlCallback(onSYNC2Control);
                                    
                                    A 1 Reply Last reply Reply Quote 0
                                    • A
                                      aaronventure @Straticah
                                      last edited by

                                      @Straticah I think we need an FL Studio flag 😂

                                      For real, tho, you can call Content.callWithDelay in the init, set it to like 100ms or so, where you both set the knobs to their current values and repaint them.

                                      A silly fix but hey...

                                      1 Reply Last reply Reply Quote 1
                                      • Dan KorneffD
                                        Dan Korneff
                                        last edited by

                                        I had an instance where a function was running before a variable was calculated, so the knob was set to 0 (undefined).
                                        I had to use callAfterDelay to set my knobs like this:

                                        Content.callAfterDelay(1000, function()
                                        {
                                            	
                                        	if(myValue == undefined)
                                        	{
                                        		myValue = myKnob.getValue();
                                        	}
                                        
                                        }, this);
                                        

                                        Dan Korneff - Producer / Mixer / Audio Nerd

                                        StraticahS 2 Replies Last reply Reply Quote 2
                                        • StraticahS
                                          Straticah @Dan Korneff
                                          last edited by

                                          This post is deleted!
                                          1 Reply Last reply Reply Quote 0
                                          • StraticahS
                                            Straticah @Dan Korneff
                                            last edited by Straticah

                                            @Dan-Korneff Hm i could not get it to work, where should this function be called?

                                            I assume the value refers to GRAINS.SpeedL and i want Knob7 to getValue();

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

                                            25

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.8k

                                            Posts