About C++ Nodes
-
So, I've set up a c++ node in scriptnode (tools > create3rdpartynodetemplate)
It's all working and I can compile it in HISE.
But I'm a little confused at how I can debug this! I can't run the code outside of HISE (not sure how this would be done) and the console out, as well as the juce commands for printing to console don't work.
Hise gives me an error reports when I compile nodes that have issues,
and from that I can debug,But I've quickly reached a point where I need access to better testing, for example I've been trying to fetch the sample rate and I cannot tell if I've done it right because I can't print it.
Perhaps I have not set everything up properly for developing 3rd party nodes? Advice would be appreciated thank you!
I've got the node template all set up in c++
My second question is to do with what I was attempting to do in the first place, get hold of sample rate to keep track of time as each sample is processed. Very Important a lot of dsp I should think.
-
-
Perhaps it's a question for @Christoph-Hart !
I really like the idea of writing c++ nodes for use in scriptnode, but for a beginner it's very hard getting set up, because the docs don't describe the process of c++ nodes very well, it's vague from my perspective.
If I can get it figured out I'd definitely like to upload a library of C++ dsp here.
for people to use in their sample libraries. -
You can use the Visual Studio debugger for debugging C++ nodes, which is a very nice workflow (so nice that I'm doing this more often than actually writing SNEX code lol).
The setup is really simple:
- Build the Debug version (or Minimal Build configuration) of HISE.
- Export the dll.
- Open the solution (.sln) file in VS2022. It can be found under DspNetworks/Binaries/Builds/VisualStudio2022.
- Choose "Debug" as configuration. Head over to the project properties and ensure that the HISE debug binary is being set as debugging command (the solution should have filled this out for you automatically)
- Compile the solution from within VS2022. When it's done (which should take < 30 s), it should open HISE automatically
- Add a hardcoded FX and select the node you want to debug
- Add breakpoints & profit
-
@Christoph-Hart
I will test this and then close the topic if all goes well!
Thanks for your response, I've been working on this in the dark a bit for a few weeks, I'll be very happy to have this working -
Okay the bit that I'm struggling with is:
"Head over to the project properties and ensure that the HISE debug binary is being set as debugging command (the solution should have filled this out for you automatically)"
I'm not sure what this means.
I've got both the debug and the release version of HISE built on my PC now.
I go into my hise project files and find "projectname .sln"
Opening that up in visual studio and building it as debug, doesn't open up HISE automatically.
I'm guessing it's because it's using the release version of HISE instead of the debugging version?
-
@griffinboy project properties in visual studio once you open the solution
-
I did this and it still didn't launch hise as expected once built : (
This was obviously the wrong thing, Christoph talks about pointing it at hise debug, but I'm not sure where to do this.
"Check that HISE debug binary is being set as debugging command "
Perhaps it's something I have to write here?
-
@griffinboy
bump. Apologies -
@griffinboy Womp womp
-
You're almost there, you need to right-click the "Parallel Bandpasses_DynamicLibrary", not the Solution. It's the first nested entry in the solution browser.
Then, check the path set to "Command", visible when navigating "Configuration Properties" -> "Debugging". This path needs to reference your HISE binary.Save and hit run
-
This post is deleted! -
-
This post is deleted! -
-
This post is deleted! -
-
Okay I solved it.
I think I'll make a whole video about this process later for any noobs like myself. -
@griffinboy that would be epic for a noob like myself!
-
It's in the works!
I've spent two months diving into the source code,
to find the best practices for writing dsp in Hise.
It's a deep rabbit hole, but luckily I'm getting close.I'm looking forward to releasing a lot of freebies and sharing my templates.