Best way to script a widget
I'm curious what the "proper" way to script control of a widget in the interface that is controlling a module's parameter.
Here's the situation: in the main interface, I'm using mutliple instances of dial widgets to control different module parameters for effects and whatnot. In turn, I am scripting via onController() to set the values of those widgets based on input from MIDI data coming from a hardware controller.
Widgets are connected to their designated modulation targets via the processorId and parameterId in the property editor. When using the mouse to control the widgets, they work as expected. However, when scripting their value changes, their linked modulation targets are not changed.
Currently, I'm additionally forced to script value changes in onController() directly to the modulation targets in the modules themselves. But this seems inefficient, and is certainly undesirable from a readability standpoint. Is there a better way to do this?
Thanks for reading
@amounra Don't use on controller, use MIDI learn.
@d-healey Thanks for the recommendation, but that's simply not an option in this case. Is it simply not possible to do this from scripting?
Here's another case where this paradigm simply doesn't work:
I'm trying to create a single button that can reset all sub-modules to their original, default state. This is convenient for development, but also will be necessary for the end user so they can reset certain aspects of the plugin after they've made possibly catastrophic or confusing accidental changes. My understanding is that there's no way to connect functions of a sub-script to a higher level script in order that they can be triggered by the main IF through to the subscripts. So, I've created button in a script processor of the main container. In addition, I've created reset buttons for each of my sub-containers in the main container, linked them via processorId/parameterId to buttons inside those sub-containers that trigger the reset functions (this is for resetting bank specific callback definitions, etc). If I press any of the individual reset buttons in the main container, they trigger the reset functions in their corresponding sub-container as they should. BUT, there seems to be no good way to create a "master button", have it's setControlCallback() trigger the buttons in that same container to call their siblings to call their corresponding sub-functions.
This is all very confusing to me. I understand that it's necessary to do things in HISE in a certain way, but some of this seems so "backwards"....any help is appreciated.
I'm not sure I fully understand, there seems to be two different issues here.
One is you want to control knobs with CC, the simplest way is using MIDI learn, why is that not suitable for your use case?
The second issue is you want buttons of one script to control the buttons of other scripts (I think). Could you provide a minimal snippet that demonstrates the issue you're having as simply as possible so I have a better understanding?
In the outer container, there are three buttons. The first one is meant to relay to the second two, which are connected to buttons in the sub-containers. Pressing any button except for the main "ResetAll" button has the desired effect, i.e. to reset the SliderPacks in the sub-containers. Try moving the slider packs ('Data') and then hitting the resetAll button....
Thanks for looking!
I see what the problem is. To trigger the action of another widget you need to use the
So your reset all function will look like this:
ResetAll.setValue(0); ResetContainer1.setValue(1); ResetContainer2.setValue(1); ResetContainer1.changed(); ResetContainer2.changed();
Awesome I haven't tried it out yet, but I'm sure that'll do it....thanks!! That solves some problems!