ScriptNode Feedback After a Month of Heavy Use
-
@aaronventure ah ok, so to iterate over each sample of each channel you simply have to use a nested loop:
// iterate all channels for(auto& ch: data) { // create an from the iterator object ch for(auto& s: data.toChannelData(ch)) { s = Math.random(); } }
The magic spell in this case is probably the
toChannelData()
method that will turnch
into a properdyn<float>
block.HiseSnippet 1609.3oc2X80aaaCDWxIJY1sqqEsaOqmJb.BbSZ65FV5Zahi8pwVbLpRC5aArRzwDlhTPjJwdC888wZej52fs6DkrjrcSa75FvlMhk3cG4c2u6OjLzIZpHfFblRvhhnZKK60FDK8oJkL1xt9ISinV12zwapPOp8HBSX06PK6a4bDQoowtFRGLMhnTz.Ka609Ijfc80sR+79me.gSD9zBRVVmJY9zegExzETG7helw4cIAzSXgkj9wunmuTzVxkIf8rlyNVQD+wjyo8InX0brr2nS.SKi8zDMUAxbfLXp2H4kBi7mxTr2xo3fcs7fExP1p8HFOXlup.Oe8Rd9ZFO+dNGwBXynWf.2NkgawLJiA10tJSZ2qgIYWxjV2XR2wwyOlEoK3f1yMb5If.xPB.0kMEirV1+gSaIHfP2JjLl1MFFLaBMexN6rsK7yV6MLQ3qYRgqTzWpoGKZtUieqQ8Fuqg67rFNbo7P0DK4bZ7RYiQ23qZhMEIgukFus6EDdBclff6WES23SCS8MdcIAkhdBl93HZ13tRd.hU36KFArxfM3sW26PhlfAkLZfbQzXMCMG6CoW.Y0lPTcmCopwZYDjWuP7CxbjAIbhtZ5DV2jw.viJwPLPITL8zx0UWibrctxbrOUS7NNCXZ+QK2FqsDaDPp+IrwrJyuzoyvgTecgAttS22rpkg6bsKCajUFB5DU9MyF518M6tzBve2oHYOJlFQhomHGvISapHgQb5q.aba22xk9i8X+JcwJjHiIb.JQS+QDgfxUqRgzFelZNY8JYhlIN+HhNlMwx1oeRnGzl1m1Ny5.Z10vZHy3cvwXdgGrmS5f+D9jwbWbrcFycyYVp7qOUeoLdbZ3H6cK6MMXuJEjOa3Dv7owJL4zdSmcZAes1mykW1VFFwxRagfRJs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EroJhHd5Ptjn2FDnr2rL0bTuC64Ru.xepDhA+HfSeIjMzA40b1a22ktPn30o4LLUwMc0RWHnkDkpB5DncN5Knkjs9.2NYjMfkTnztkIAF91tnSxvsfWPmd4IOy1uXoHzfLDBz2rcVZFHSfBQ2Kptnn3Uyce3dMd2dMrr9K.PTIL7B
Load up this snippet, then inspect the
numChannels
data member while you drag around the node in various places. It's guaranteed that theprepare
callback will always be executed before theprocess()
callbacks are coming in, so you can use that information too for figuring out channel-specific stuff.I also noticed the error with the channel count when I started writing the example :)
However it goes away if you save and reload the network - I think the problem is that if you create a new SNEX file and compile it the first time it assumes stereo processing, but in subsequent compilations it picks up the actual channel count correctly. -
@aaronventure Not to derail your current conversation but but you make some excellent points so kudos to you for putting it altogether in a single post. Coming from more of a MAX MSP background I am definitely seeing Scriptnode as a robust DSP alternative, and I think it is part of what is drawing so many users to HISE.
I have been messing around in Scriptnode for over a year now and I have noticed most of the issues you brought attention to. I think the docs could use a healthy touchup. I personally feel a few tutorial videos on making Scriptnode networks would put an end to half of the forum posts we see on the topic. My personal feeling is we need a D. Healey but for Scriptnode. to come out of the woodworks.
There are a lot of functions that are hidden in Scriptnode already that users aren't familiar with that greatly increase workflow (wrapping DSP networks, the importance of different container types, show/hide cables, copy range to source, loading DSP Graphs, etc.). It took me a while to figure out these things were there.
I actually agree with Christoph about modularization, as it reminds me more of how MAX MSP operates. It really isn't the cleanest, but encapsulating certain aspects of DSP and recycling them across networks is a more ideal solution. If there were a simpler/clearer way to share these across projects without having to drag network files across projects, that would be great.
One feature I personally have been eagerly waiting for is a buffer inside Scriptnode which opens up a can of DSP worms. I know there is the Recorder Demo Snex project, which is perfect, except that it still doesn't compile
Other issues I noticed is embedding RNBO .dll in Scriptnode requires you to resave the network each time before compiling .
The IDs are the number one issue so glad to see that is being addressed. I have had other issues that I can't recall that I will post here after I give it more thought.
Also, sorry to derail the conversation further, but how do you add comments/labels inside Scriptnode? I never figured this out but I have a few projects I intend to share soon to help users cut their teeth with Scriptnode, so I want to be able to explain the signal chain.
-
@HISEnberg said in ScriptNode Feedback After a Month of Heavy Use:
, sorry to derail the conversation further, but how do you add comments/labels inside Scriptnode? I never figured this out but I have a few projects I intend to share soon to help users cut their teeth with Scriptnode, so I want to be able to explain the signal chain.
Right click any node and type it in
-
@aaronventure Wow thanks, it was staring me right in the face
-
Thanks for the snippet.
@Christoph-Hart said in ScriptNode Feedback After a Month of Heavy Use:
// iterate all channels
for(auto& ch: data)
{
// create an from the iterator object ch
for(auto& s: data.toChannelData(ch))
{
s = Math.random();
}
}Do you think it's a good idea to put this structure in the base template? I can't imagine a scenario where I wouldn't want stereo linking without offering a stereo linked version as well.
-
@Christoph-Hart said in ScriptNode Feedback After a Month of Heavy Use:
You can already "move" chains to an external file. Click on the package icon and Choose Wrap into DSP Network. The UX is all over the place and you need to press resave after performing this step, then unload and reload the network, but the basic functionality is exactly what you suggested - it even retains the parameter connections.
I think part of the issue of this being hidden is that it's only visible in the package icon in the main toolbar, and not if you right click the node.
-
@HISEnberg Yes! I would love a buffer! Insane granular experiments would ensue
-
@Christoph-Hart since you seem to be on a bug killing spree and have grazed Scriptnode, I feel like now's a good time to mention this.
2 things.
-
With the new improved clarity regarding hidden nodes, what do you think about further improving this (or having an option for it in the toolbar) by printing the differentiating node hierarchy in a namespace way when hovering a connection? https://forum.hise.audio/post/81634
-
Is there something that can be done regarding UI performance of Scriptnode when working with big networks? If you have 200 nodes, adding another one or collapsing any one makes the whole network do a visual refresh: the display engine loops through every single parameter of every single node, one step at a time, refreshes it, checks its min/max, and refreshes the graphic. This effectively freezes the network until the process finishes. This is a complete non-issue in smaller networks but when going big, it does become problematic. Can these be grouped into a smaller number of draw calls? Would the CSS renderer help here? You mentioned it bypassing the message thread issue that LAF seems to be running into. Any other ideas?
-
-
@aaronventure sure why not.
- I've added the full path of all non-equal parents like you suggested. However I realized that the label I've added clashes with the tooltip so I'll remove the label and put the string in the global tooltip (there's also a problem with the tooltips appearing at the wrong position when zooming the scriptnode UI so that has to be fixed anyways).
- Sure there is some room for optimizations in the scriptnode UI. I've noticed that it still creates all child nodes even if the container is folded. I'll try what happens if I don't do that, as this might heavily increase the performance of big patches (assuming you're a good boy and don't work with the entire network being visible like a complete maniac)....
-
@Christoph-Hart said in ScriptNode Feedback After a Month of Heavy Use:
(assuming you're a good boy and don't work with the entire network being visible like a complete maniac)....
Yup, I'm making good use of chains to fold groups into groups. Network this big, organisation really is key.
Thanks.
-
@aaronventure Alright, please have a go at it, I've just commit a change that skips rebuilding all child nodes for folded containers.
Let me know if you run into glitches, these kind of changes are very prone to breaking things.
I've also fixed the tooltip scaling and moved the popup label into the tooltip so that they won't clash anymore.
-
@Christoph-Hart oh yeah this is much faster now. Awesome.
No issues so far with existing networks, adding, removing etc. I'll report if anything happens.
The cabling tooltips and the source highlight is also great. Thanks.
Another issue is now brought forward: since it's now 100% desired to fold down everything not worked on right now in big networks, the folded node visuals are rather unclear. The text is cut off because the node is forced into a preset small width.
Other than the aesthetics of a network with folded nodes, is there a reason why the node width doesn't automatically adjust to display the entire Name property?
Comments could tackle this somewhat, but only for one orientation: swapping orientation doesn't swap comment position, so putting comments on nodes in a horizontal chain makes it that much longer. https://forum.hise.audio/topic/9816/put-node-comments-above-below-nodes-when-the-container-is-laid-out-horizontally
One other thing: the change you pushed a few weeks ago where the Name property was introduced to prevent us from messing up ids, the node's core id has gone missing. So there's no longer a way to tell what is the base name of the node / node type. This is highly problematic for newbies that open existing snippets which have had the node names changed, and somewhat problematic for devs who have a small amount of RAM in their head and commonly find themselves in "what the fuck did I do here" situations.
Do you think adding a non-editable property that mentions the base node name (e.g. container.chain ) somewhere in the node properties window, perhaps right above the new Name property?
-
@aaronventure said in ScriptNode Feedback After a Month of Heavy Use:
So there's no longer a way to tell what is the base name of the node / node type.
The tooltip will show the type, ID and name if you hover over the header.
-
Alright, the folded (and unfolded) width should now take the length of the node name into account so it won't truncate it anymore.
-
@Christoph-Hart Amazing.
To recap this thread, the only unsolved issues from my original post remain:
- comment location in horizontally oriented nodes (though I understand if this would mess up node ordering as the cables run in the top and bottom)
- navigation (auto-scroll on screen edges while holding left click drag to modulation target)
From my wishlist, it's just:
- logic operators
- unscaled clamping
- variables (which you already laid out the plan for).
Everything else has been addressed, thank you.
-
@aaronventure @Christoph-Hart Couldn't the comments be shown in a floating tile when hovering a specific area/icon on the node?
-
@aaronventure said in ScriptNode Feedback After a Month of Heavy Use:
If you have 200 nodes...
I'm sorry I'm new, but I'm trying to understand how something complex can be done with 200 nodes :)
In my first attempts, I worked with a maximum of 20 nodes :)
-
@Christoph-Hart
Oh hell yeah. Will it also work for when you enable the cpu usage label? That often gets cut off for me -
@JulesV a lot of parameters driving a lot of mini-algorithms that all talk to each other. It adds up very quickly.
-
Alright, I spend a bit more time on the scriptnode UX front:
- added "variables". However I went against your objection and named them
local_cables
because I think that's exactly what they are. Variables would suggest that they store data, which isn't the case, they just forward any value you send into it (just like a normal cable does but without the serial killer vibes when you use them in a big patch). There are a few helper functions that lets you convert cable connections to local cable nodes and vice versa (and on compilation all local cables will be replaced by normal cables so I don't add complexity to the C++ builder). Docs are here - added a toggle button for hiding all help texts and replace them with a comment button. If you click on the comment button next to the node it will expand the comment (and hovering over the comment button will show the first line of the comment as tooltip).
- changed the layout of the help with flipped containers to be below the node.
- added a few items to the DSP node list component (to the left of the network editor). Local cables are listed now at the top with the same appearance as global cables do in the global Patch browser.
- the root chain parameters are now also listed in the Node list alongside with a slider that you can use for quickly inspecting / changing the value, a label to rename it (double click!) and a drag element that lets you create connections
- parameters of a chain have now a fixed UI element for dragging to create connections. Before you always had to enable the weird edit mode (which is now solely used to delete parameters).
- added some funky drag animation because why not.
- added "variables". However I went against your objection and named them