I got a bug report for my plugin from a tester
-
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:
- 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?
-
@Straticah are the displayed values using the default knob value popup? or are they seperate labels/panels?
-
@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)?
-
@iamlamprey i am using the default one inside a LAF knob. I am not drawing the value separate.
-
"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);
-
@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?
-
@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 -
@iamlamprey its giving me "function not found" anything that i might be missing?
-
@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()
-
@Straticah yep sorry, it's sendRepaintMessage()
Knob7.sendRepaintMessage()
Knob8.sendRepaintMessage()
-
@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
-
@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.
-
@Straticah are the sliders set to save in preset?
-
@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.
-
This post is deleted! -
-
@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.
//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);
-
@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...
-
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);
-
This post is deleted! -
@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 wantKnob7
togetValue();