Global variables in 3rd party scriptnode
-
Is there a way to access a global variable set in HISE script somewhere in a 3rd party c++ script node? If so how. I am very very new to HISE
-
No, the third party C++ node follows a very strict blackbox concept with only a few limited ways of communication (global cables, float parameters and external data objects for tables, audio files etc.). Having access to the ref-counted global variable container would cause havoc across DLL boundaries.
You should be able to send the global variable into a global cable and pick it up in a compiled network that will wrap your custom C++ code.
-
Thank you for your reply, I want to have a dropdown with two choices in the ui and have my 3rd party script ode pick that choice up, I am so new to HISE that I don’t know how to set up a global cable to make this happen and how I would achieve grabbing the variable in my c++ code, it all sounds very reasonable but I still don’t know what I’m doing. Is there a snippet that does this or anything I can look at that might shed some light on this?
-
@jdurnil That's super easy to achieve:
- Add a parameter to your third party node. The template already creates one parameter, you should be able to copy & paste your way through there.
- Assign the parameter to the scripted UI through the
parameterId
/processorId
attributes.
-
@Christoph-Hart awesome! Thank you.