HI Jules and community,
I am currently working on a modular synth. I decided to create a Module class which inherits from AudioProcessor, and at the moment 2 class (VCO and SmartPan), which both inherit from the Module class.
I put 2 instances of the VCO module and 1 of the SmartPan module in an AudioProcessorGraph, using the addNode() method.
At the moment everything is working fine, but I am trying not to generate loops inside the graph. So I am trying to run Kahn’s algorythm (which checks if the graph has loops or not) after a connection is made, so that if it generate a loop, it’s possible to go back.
My question is: how can I copy the graph before adding the last connection to another AudioProcessorGraph? Should I just remove the last connection?
Also, I am declaring the graph in a “Rack.h” like this:
std::unique_ptr<juce::AudioProcessorGraph> chain; //as private member of a Rack class
I am inizializing it in the “Rack.cpp” constructor this way:
: chain(new juce::AudioProcessorGraph())
Am I doing everything correctly? I am able to call the chain->setPlayConfigDetails() method as well as prepareToPlay, processBlock and releaseResources methods.
Thanks in advance!
Giacomo