How do you use Global Cable?
-
Hey guys,
I'm wondering if anyone can quickly explain how to use:
GlobalCable.registerCallback(var callbackFunction, var synchronous)It's a line that I found in the documentation, but I'm not sure how to use it.
I am trying to use an LFO that I have programmed in scriptnode, to control a Parametric EQ.
I assumed the best way to do this would be to send the LFO out of scriptnode, using a global cable, and then updating the Parametric EQ whenever the global cable gets updated.
I have successfully sent the LFO through the cable, and I've got an ID for that cable, but I am stuck on how to create a callback for the cable.Please, and thanks : )
-
-
This post is deleted! -
-
@griffinboy I haven't been able to find other posts that ask about the Global Cable, but perhaps I haven't been searching the right keywords.
-
@griffinboy check the data visualisation snippets, there is an example usage of the global cable
-
Thanks, I'm sorry to ask this but where can I find these snippets?
I've searched through the forums, documentation, and the HISE tutorial files and couldn't see any mention. -
@griffinboy Help > Browse example snippets
-
Struggling to get it to work, I don't really understand the example code that I'm trying to port.
-
my failed attempt to try and get the global cable value when the cable value is changed
-
This post is deleted! -
@griffinboy you need to connect the mod output to the Value parameter of the global cable node, it doesn't read the audio signal.
-
@Christoph-Hart
Thanks I've hooked that up now!
The thing I'm trying to figure out is how to make a callback that uses my global send node.I'm still a little confused about how this works in HISE. I've tired to adapt the example that I found in the example snippets, but I've probably butchered it.
-
@griffinboy ah just realized you‘re using the wrong node. Use a global_cable node - the global_send node is used to route audio signals not a single parameter event.
-
@Christoph-Hart
Hell yeah!
Thank you it works perfectly now.And my callback works too.
I shall now have to find out why it works
I probably need to look into HISE syntax more -
The working solution:
-
-
I'm quite curious about what this part does
-
https://docs.hise.dev/scripting/scripting-api/globalcable/index.html#registercallback
You can either register it as synchronous callback or as asynchronous callback. The latter will filter out repetitions and will be called on the UI thread.