@Christoph-Hart
Apologies but I am going to have to ask a rather technical question!
Is there any way at all for me to store a reference (&) in an array?
I looked over the docs and ran multiple tests in the SNEX playground that you recommended, but I've had no luck.
What I am trying to do may be beyond SNEX's capabilities.
I am creating a virtual circuit. It is modular, you can declare any component and attach it to another.
I have created classes for each component type, these classes contain dsp .
These have constructors which allow me to declare new component objects easily.
But what I need to do now, is create a script which can link these objects together, and then run an audio signal through them. Each object will pass the signal to the next object until it finally reaches the output, having been processed through each of them.
The issue is, I need to store pointers to these objects in an array.
This is necessary so that I can link the objects together and create a modular signal path. Each component object has multiple terminals (functions) inside, and these terminals can be linked to any other terminal inside another object, so it's quite important that I can point to them, to store the instructions of how the circuit all comes together.
Is there any solution to this in SNEX? I have tried all the standard C++ methods to achieve this and have failed. The latest method I tried was to fill a SPAN array with references (&) which it did not accept and gave me a casting error.
The alternative is to create a bunch of individual functions and a FAT stack of IF statements to create the modular logic. As long as SNEX is able to compile functions down cleverly, then this should run very efficiently. Does SNEX work that way?
Thanks for your time I appreciate it! : )