Is it Possible to Deactivate Nodes by Name Inside a Compiled ScriptNode?
-
I'm at the 20 parameter limit, so I can't do it that way...? Cheers.
-
-
@clevername27 not by name, but by ID. You can get the node reference from the network reference, see this: https://forum.hise.audio//post/92587
After that, you can use the Node class to bypass a target node.
It only works for bypassing, not for value setting.
I've requested tree-navigated name targeting for nodes. Consider voicing your support or expanding on the idea here: https://forum.hise.audio/topic/11414/request-scriptnode-direct-access?_=1735604461313
-
@aaronventure Thanks, man!
-
@aaronventure And this will work with compiled nodes? It's definitely working with uncompiled, and this is a total game-changer—thank you!
I've noticed then when the node is turned off, the power icon still shows green—it's the node title that dims.
I'm guessing this still deactivates the node? I ask because I want to turn off parts of the ScriptNode that I'm not using (to save CPU).
But maybe I'm doing this wrong.
My Network is an additive synthesiser, and I don't know how many oscillators I'll need at compile time. So, my Network has the maximum number that I"ll need—but this is probably a huge waste of CPU cycles. So, I wanted to know how to turn off the ones I'm not using.
Ideally, I would be constructing the Network ad-hoc during runtime, but then it can't be compiled.
But then, why is it possible to even do that in API?
I'm a little confused and very ignorant, if you could please help. :)
-
@clevername27 said in Is it Possible to Deactivate Nodes by Name Inside a Compiled ScriptNode?:
My Network is an additive synthesiser, and I don't know how many oscillators I'll need at compile time. So, my Network has the maximum number that I"ll need—but this is probably a huge waste of CPU cycles. So, I wanted to know how to turn off the ones I'm not using.
Are you using a clone container, might be useful here.
-
@clevername27 said in Is it Possible to Deactivate Nodes by Name Inside a Compiled ScriptNode?:
And this will work with compiled nodes?
What do you mean by compiled nodes? This targets a node inside of a network. It's unlikely to work if you compile the network and replace it with a hardcoded network, because it's expecting a reference. The point of that whole API is to eventually be able to create and operate fully dynamic scriptnode networks at runtime, but it's unfinished as of today.
If you compile a network and load it as a node in another network, that should work because you're again targeting a node in a network.
You can confirm if it deactivates the node by targetting an oscillator or an effect and hearing whether it goes away (it should). You can enable CPU usage display in scriptnode from the toolbar and see if if the usage goes down when the node gets bypassed (again, it should). It's probably easier to test it on something like convolution because the oscillators have very little cpu impact, it barely even reads out sometimes over here.
For an additive synth, consider using the clone nodes which will let you dynamically bypass higher overtones.
-
@aaronventure said in Is it Possible to Deactivate Nodes by Name Inside a Compiled ScriptNode?:
What do you mean by compiled nodes? This targets a node inside of a network. It's unlikely to work if you compile the network and replace it with a hardcoded network, because it's expecting a reference. The point of that whole API is to eventually be able to create and operate fully dynamic scriptnode networks at runtime, but it's unfinished as of today.
I meant "Nodes that are compiled as part of a Network." Are you talking about compiling a version of a plugin, but not compiling the ScriptNode networks? (I get an instant crash if I try to do that.)
-