HISE Docs

Node


The "Script" part of Scriptnode means that you can use HiseScript to programmatically modify, add or remove nodes within a DSP network. This can be used to build up dynamic FX chains, programmatically create complex patches that would be annoying to patch up manually or other use cases that require you to change the layout of your DSP network.
The Node object is how you can access a node with scripting. It is usually created / referenced from a DSPNetwork scripting object and then can perform almost every operation that you do in the scriptnode workspace:

// create a reference to a scriptnode network with the given ID
const var sn = Engine.createDspNetwork("my_network");

// create a reference to the root container of that network
// (!= the network itself)
const var rootNode = sn.get("my_network");

// Add a oscillator with the ID "osc"
const var node = sn.create("core.oscillator", "osc");

// Add the oscillator to the root container.
node.setParent(rootNode, -1);

Console.print(node.getNumParameters());


Class methods

connectTo

Connects this node to the given parameter target. sourceInfo is either the parameter name (String) or output slot (integer).

Node.connectTo(var parameterTarget, var sourceInfo)


This function can be used to connect the modulation output of this node to a target parameter.

If you want to connect a parameter of a container to another parameter you will need to use the Parameter.addConnectionFrom() method which operates on the target parameter.

You can call this method on any node that has one or more modulation outputs. This modulation output will be the source of the connection and the method will create a connection from this output to the targetParameter:


connectToBypass

Connects the bypass button of this node to the given source info ("NodeId.ParameterId"). Edit on GitHub

Node.connectToBypass(var sourceInfo)



get

Returns a property of the node. Edit on GitHub

Node.get(var id)



getChildNodes

Returns a list of child nodes if this node is a container. Edit on GitHub

Node.getChildNodes(bool recursive)



getIndexInParent

Returns the index in the parent. Edit on GitHub

Node.getIndexInParent()



getNodeHolder

Not necessarily the DSP network. Edit on GitHub

Node.getNodeHolder()



getNumParameters

Returns the number of parameters. Edit on GitHub

Node.getNumParameters()



getOrCreateParameter

Returns a reference to a parameter or creates a parameter (if non existent and possible). Edit on GitHub

Node.getOrCreateParameter(var indexOrId)



isActive

Checks if the node is inserted into the signal path. Edit on GitHub

Node.isActive(bool checkRecursively)



isBypassed

Checks if the node is bypassed. Edit on GitHub

Node.isBypassed()



reset

Reset the node's internal state (eg. at voice start). Edit on GitHub

Node.reset()=0



set

Sets the property of the node.

Node.set(var id, var value)


There are two concepts of "states" for a node:

Examples for parameters:

Examples for properties


setBypassed

Bypasses the node. Edit on GitHub

Node.setBypassed(bool shouldBeBypassed)



setComplexDataIndex

Sets the complex data type at the dataSlot to the given index and data (if embedded). Edit on GitHub

Node.setComplexDataIndex(String dataType, int dataSlot, int indexValue)



setParent

Inserts the node into the given parent container. Edit on GitHub

Node.setParent(var parentNode, int indexInParent)