3rd party node setexternaldata
-
I have a 3rd party script node I’m working on, it will be dealing with two fft analyses. I would like to send these each out in a displaybuffer slot(two slots) but on the 3rd party node I can find no option to add a display buffer in the node. I see there is a method in the code setexternaldata, is this something I could use and if so is there an example somewhere I can’t find anything related to this on the forum or in the docs.
-
@jdurnil Okay, so I did this recently.
What you do, is you create a modulation output on that node, This has to be done using code.
Then you attach the output of the modulator to a 'add' node and then into a peak node (which contains a display buffer), or to a global cable if you don't need the buffer. These parts can be inside a 'modchain' container in order to make sure no audio is generated from the modulator.Here is the code that you need to ADD to your scriptnode.
// This function updates the modulation output bool handleModulation(double& value) { return modValue.getChangedValue(value); } modValue.setModValue(0.5); //Set the modulation output to a value (it has to be a double data type) ModValue modValue; // This needs to be included in your script. It means that when you set the modulation value, it calls the funtion to update the modulation output to that value
I'm not sure if it's possible to create two mod outputs though, I've never tried it, so I can't help with that.
If you are planning on drawing the display buffer on-screen, I don't recommend it.
It's quite inefficient. I would send the instantaneous mod output value to a global cable (scriptnode node) and then use an OpenGL script to buffer and draw the graph smoothly, and efficiently using the GPU rather than refreshing the screen every time that the graph needs to be drawn. -
@griffinboy thank you this is extremely helpful!