How do I use AudioProcessorGraph::addConnection?
I've successfully made a working graph of: midi-input -> VST-instrument -> audio-output
I now want to add an effect: midi-input -> VST-instrument -> effect -> audio-output
When I connect the instrument-node to the effect-node, which source and destination channel indexes should I use? I suppose that it depends on the plugins themselves and how many output and input channels they each have. But how do I find this out, and then get the channel-indexes for them?
I can see that the AudioProcessor class has getNumInputChannels() and getNumOutputChannels(). Should I use these? And if I do, how do I get the channel indexes for them? For example:
- The instrument has midi input and stereo output
- The effect has stereo input and stereo output
What are the indexes for the instrument's output? What are the indexes for the effect's inputs and outputs? Is it the case that addConnection is always connecting the source node's outputs to the destination node's inputs, and the indexes are just zero-based indexes up to the number of channels? So for stereo connections would it always be:
graph.addConnection(sourceID, 0, destinationID, 0)
graph.addConnection(sourceID, 1, destinationID, 1)
Sorry if this is a stupid question... but it's confusing me at the moment!