This is actually a bit related to a 9 day old post of mine on “Trying to do some DSP processing on single voices” here Trying to do some DSP processing on single voices.
For a special need, I need to pass an array of 8 AudioBuffer’s, inside “processBlock” in PluginProcessor to voices in “SynthVoice.h” which has it’s own local array of 8 buffers and where I am doing single voice processing, and which are at the end added to the passed buffers, and back in “processBlock” in PluginProcessor some of these may be further DSP processed,and finally added to the “normal” “processBlock” buffer. All buffers are of type AudioBuffer and allocated to same number of channels and size.
Sorry it may sound, phun intended, complicated and I guess it is, but I am trying to do something I’ve have never seen before on a synthesizer. Anyways all is good if I pass one buffer of an array at a time using either of the below methods in “processBlock”;
AudioBuffer<float>& TGPtr = TGBuffer[0];
mySynth.renderNextBlock (TGPtr, midiMessages, 0, buffer.getNumSamples ());
or
mySynth.renderNextBlock (TGBuffer[0], midiMessages, 0, buffer.getNumSamples ());
and over in “SynthVoice.h” I got;
void renderNextBlock (AudioBuffer<float>& outputBuffer, int startSample, int numSamples)
So what I really needed to do was something like this;
AudioBuffer<float>* arrayPtr[8];
for (int i = 0; i < 8; i++)
arrayPtr[i] = &TGBuffer[i];
mySynth.renderNextBlock (arrayPtr, midiMessages, 0, buffer.getNumSamples ());
and over in “SynthVoice.h” something like this;
void renderNextBlock (AudioBuffer<float>* outputBuffer[], int startSample, int numSamples)
I humbly admit that my lack of knowledge with pointers is probably why I can not get this to work. Any help will be greatly appreciated, but let me add I won’t be offended with replies linking to “C++ Pointers for Dummies”.