Passing info between scripts
-
If you add a script processor to, say a sampler. Is there a way to pass information between a Interface script to the samplers script processors? Say that you have a slider that you want the samplers script processor to know the value for
-
@Sampletekk You can use global variables - but don't unless you have no alternative... or you're Aaron.
The method I prefer is think of each script processor just like you think of the built-in HISE modules.
For example if your project has a Simple Gain effect and you want to control its Gain knob from your UI, how would you do that? You'd either use processor/parameter ID or you would use .setAttribute. Well you can do exactly the same thing with your custom script processors.
So add a slider to your script that does the thing you want, then connect the slider on your UI to the slider of your script using one of the two methods I mentioned.
I demonstrated this in a recent video on Patreon. https://www.patreon.com/posts/control-multiple-115190059
-
@d-healey Thanks David! That should do the trick!
-
this snippet https://forum.hise.audio/topic/10635/snippet-per-event-modulation-from-ui-with-global-storage
has an example of globals usage where the interface and the processor script talk via a global object.