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.
    • ?
      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
                                • A
                                  aaronventure @Straticah
                                  last edited by

                                  @Straticah the idea is to call this method in your on init callback so that the function in there executes after on init.

                                  You can call your repaint methods in that function to see if they reset the graphics correctly.

                                  If they do, you have some value setting call somewhere that does not refresh the interface. Add some isDefined(checks) when setting values.

                                  But at that point, if it works with no drawbacks, you can just leave it like that. It's ugly and hacky, but it's an edge case.

                                  I shipped worse.

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

                                    @aaronventure @Dan-Korneff it did not works because the script is taking the value. And the value in this case is a variable it has two scales, and it usually takes the 0-18 scale which is not the one i need. (im also a true beginner when it comes to these types of scripts)

                                    inline function onSYNC2Control(component, value)
                                    {
                                      GRAINS.setAttribute(GRAINS.Delay_Sync, value);
                                      
                                    	if(value)
                                    	{
                                    		// the callAfterDelay script takes this as GRAINS.SpeedL
                                    		Knob7.set("mode", "TempoSync");
                                    		Knob7.set("min", 0);
                                    		Knob7.set("max", 18);
                                    		Knob7.set("stepSize", 1);
                                    		
                                    		Knob8.set("mode", "TempoSync");
                                    		Knob8.set("min", 0);
                                    		Knob8.set("max", 18);
                                    		Knob8.set("stepSize", 1);
                                    
                                    
                                    	}
                                    	else
                                    	{
                                    		// but this is needed in this case
                                    		Knob7.set("mode", "Time");
                                    		Knob7.set("min", 0);
                                    		Knob7.set("max", 1000);
                                    		Knob7.set("middlePosition", 500);
                                    		Knob7.set("stepSize", 1);
                                    	
                                    		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);
                                    

                                    is there a way to double click the sync unsync btn: in this case Buttonsync1 twice on loading to refresh the state? i know this is quite bad but this vst has already been sold and i am not able to change this setup into two independent sliders (which has been recommended), i would have to redo all presets and the users could not use the new vst version with their old projects.

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

                                      @Straticah said in I got a bug report for my plugin from a tester:
                                      and the users could not use the new vst version with their old projects.

                                      -- this case is exactly what the pre and post preset callbacks are for...

                                      HISE Development for hire.
                                      www.channelrobot.com

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

                                      27

                                      Online

                                      1.7k

                                      Users

                                      11.8k

                                      Topics

                                      102.8k

                                      Posts