How to access nodes via scripting?
-
I assume its via the Node API, but how does that work, exactly?
Does anyone have an example of directly adjusting node parameters of a scriptnode network by using the node's ID?
I need a reference to the node itself to use the Node API functions, right? How do I obtain it?
If the node is a convolution reverb, how do I change the impulse response via script?
Thanks.
-
@aaronventure said in How to access nodes via scripting?:
If the node is a convolution reverb, how do I change the impulse response via script?
Add an external audio file.
Then create a reference to it in your script
const af = Engine.createAndRegisterAudioFile(0);
Then you can use the various audio file functions to interact with it.
I don't know the answer to your first question.
-
While accessing nodes directly is possible, I wouldn‘t use it in your case - use external audio file slots and create root parameters that you hook up to the knobs you want to control - if yoi treat the network as blackbox like this you can export it to C++ and use a hardcoded FX module which has a few advantages.
-
Thanks guys, got it working. The references need to be assigned in the network script and if the array is declared as global, AudioFile.loadFile can be executed in the interface script to change the loaded IR.
@Christoph-Hart Out of curiosity, how does accessing the nodes work? I'm aware of creating parameters and linking them to controls, that's how I set up all my networks. Is there any reason whatsoever one would ever need to access a node directly?
-
@aaronventure theoretically it would allow you to create completely dynamic signal paths but I never found myself using it in a real-world project so it‘s a bit unfinished (some API methods are missing / undocumented etc).
-
-