Organisation
Like any visual programming environment, Scriptnode can be used to create very complex patches which can become visually overwhelming pretty quickly: You will find yourself often in the zone where you drag cables around, change parameter values and it all makes sense and sounds great, but if you come back to it a few days or even hours later, you're looking at a complete mess that is impossible to parse for a human mind:
Yuck. The UI of the scriptnode development environment was designed to be similar to a modular synthesiser because it looks cool, but as soon as the amount of cables and node exceed a sane number, it just becomes crazy town (and if you're not rocking a RTX4090, then it will also be laggy as hell).
Luckily there are quite a handful of tools to mitigate this problem and cleanup your network and this chapter tries to list the most important ones.
We'll also describe the most effective way of using these tools here, so even if you know the basics, it might be worth a read to ensure that you'll get the smoothest workflow experience possible.
Node tools
We'll start with the tools that you can apply to each individual node before moving on to higher level tools of reorganising the structure of your network.
Naming
This might be the first thing you should do. For a long time the nodes had only a ID which was used for creating connections & other things and changing this ID caused many issues which is why it was considered a danger-spooky-scary zone for longtime scriptnode users. Luckily, these times are past us and now the header label of the node is just using a completely separate string that you can use to describe the purpose of each node.
Of course you don't need to change every node name just because you can, but sometimes the function of the node in the network will be different from its autogenerated ID, and for these cases it makes sense to reflect that in the naming of the node.
The most easiest way of changing the node name is to simply click on a node, press F2 and enter the new name.
Colour
The node colour can be used to improve the visual clarity of the network:
- group nodes that are somewhat connected
- highlight important nodes
- set the cable colours
The best way of colouring nodes is to select all nodes that you want to have the same colour, then smash the colour icon in the toolbar until the randomizer spits out one that you like.
Comments
Adding comments is a pretty basic concept when using a textual programming language and you should make it your habit to encorporate this into your workflow with scriptnode as well. The same principles apply here too: you should try to make your code (read: network) comprehensible without comments, but if this is not possible or you want to guide the user's attention, you can use comments to add a description text next to a node.
In order to add a comment, right click on any node, then edit its Comment
property field. When you apply this, it will render it with markdown support next to the node.
With HISE 4.1.0 you have the ability to hide all comments by default and just show a comment button that will unfold each comment on its own.
Example
Now let's take a look at an example network before and after we applied the three tools:
This is a rather simple network, but even here it's not super clear what's going on. After applying colours, naming & comments where applicable, we get this beauty:
Connection / cable tools
A big source of visual confusion of a scriptnode networks are the cable connections: while the nodes will be structured in a sensible way which follows the signal flow, cable connections can be all over the place and as they are rendered on top of the nodes, they can end up blocking the view quite easily.
The first thing you need to know when it comes to cables is that you can make them half-transparent by pressing C
on your keyboard (or use the Toggle Cables
button in the toolbar).
Use local cables
local_cables are a recent addition to HISE and replaces cable connections with a source and a target node.
There are tools of converting cable connections to local_cables and vice versa. Check the documentation of the nodes for more information about this.
Fold nodes & hide parameters
Nodes that are folded or parameters that are invisible do not render their cable connections. You can use this to blend out connections that steal the focus from the thing you're working on.
Double click on a node header to "fold" the node. Click on the parameter button in a container's header to show / hide the parameter row.
Example
Let's take a look at an example again: Here is a network with many cable connections that looks very intimidating:
After replacing the cables with local_cable nodes and using the colour property we get a much cleaner looking network:
Container tools
The last category we want to look at are tools that are applied to container nodes to change their visual appearance / layout of the network. These are the most powerful tools in your pocket so knowing them is paramount for getting the best possible visualisation of your network.
Vertical / Horizontal alignment
The default arrangement of nodes in a scriptnode network follows this concept:
- Serial processors arrange their nodes from top to bottom
- Parallel processors (eg. split or multi ) containers arrange their nodes from left to right
With this simple rule, the default layout of scriptnode creates a two dimensional layout that is very easy to understand (and the cables below the node further help with the signal flow). However there are a few cases where this creates a needlessly big network, e.g. here:
For these cases it makes sense to flip the layout of certain containers.
This can be achieved with the "Swap orientation" button in th scriptnode toolbar.
If we flip the orientation of the first container, we'll get this:
Focus a container
Often you will find yourself working on certain parts of your scriptnode network (eg. a special modulation chain that will produce a signal) or one of multiple effect algorithms that is part of a bigger effect. For these situations it is recommended to use the focus feature to "zoom" in on a certain container and blend out the rest of the network.
Take a look at this network, which consists of a reverb and a delay effect:
Now if we want to work on the delay part of the network, we'll always have those pesky cables from the reverb in the way. That's where the "Show container as root" button comes in handy (the workspace icon at the top left of each container). If we click on it, we'll get this view:
You'll still see incoming cables from parent containers, but it will remove all other things that are not related to this node.
Note that when using this feature you can still see / change the root network parameters from the Node list or the Parameter popup component. And if your mouse has X1 / X2 buttons you can use them to navigate back and forth.
Locking containers
The last item in this chapter might be the most powerful one and it allows you to vastly reduce the complexity of your network through a "divide & conquer" approach: with the locking feature you can turn any container node of the network into a "blackbox" node that will only show its parameters (and if existent), a modulation dragger. Having the ability to tuck away all details of how a node works and just treat it as a "opaque" node is incredibly useful and you should make use of it as often as possible.
Note that this comes with absolutely no performance impact as it's just a visual feature: the network will still process the node and its children as if they are "unlocked".
Let's take a look at a modestly complex network: we have one container that processes the macro parameter and then another container which houses a modulation chain which modulates the oscillator plus an external filter:
Now by locking the first two containers, we'll get a super clear layout of the root network that gives you the ability of understanding the functionality of it on a high level:
In order to lock a container, select it and click on the lock icon in the scriptnode toolbar. This can also be used to unlock a container (and the operation is fully undoable).
Note that if you want the container to show a modulation dragger, you will have to use the control.locked_mod node as immediate child node of the container.
The "Show container as root" function is also available for locked containers, which you can use to quickly peek inside the inner workings of each locked node.