So I am still working on my first synthesizer, on it’s way to become one that may have more waveform manipulation than man (and woman, and hermaphrodite) have ever seen before, so far having 20 ways to manipulate duty cycle, 27 modulation types (several variations of each; AM, RM, PD, PM, and FM), 11 wave shaping types, and 8 wave morphing types, all with one or more ways of adjusting effect, and all individually on 8 tone generators each up to 16 unison voices.
Anyways I am now implementing a few simple JUCE DSP effects, first being the Reverb.
So the below works;
tgTempBuffer.copyFrom (0, 0, TGBuffer.getReadPointer (channelLeft), buffer.getNumSamples ());
tgTempBuffer.copyFrom (1, 0, TGBuffer.getReadPointer (channelRight), buffer.getNumSamples ());
dsp::AudioBlock<float> output0 (tgTempBuffer);
dsp::ProcessContextReplacing<float> context0 (output0);
processorChain[tg].process (context0);
TGBuffer.copyFrom(channelLeft, 0, tgTempBuffer.getReadPointer(0), buffer.getNumSamples ());
TGBuffer.copyFrom (channelRight, 0, tgTempBuffer.getReadPointer (1), buffer.getNumSamples ());
What I doing here is only adding reverb on one tone generator (tg) numbered 0 through 7, at a time as the user specifies. TGBuffer has 16 channels, 8 stereo pairs. So tone generator one occupies channels 0-1, two occupies 2-3, and so on.
In the above code I copy a stereo pair from TGBuffer, one channel at a time, so two for a stereo pair, to a temp buffer, invoke the reverb processing, and then copy the temp buffer back to the TGBuffer. So for example to process reverb on first tone generator (0), variables channelLeft = 0, and channelRight = 1.
So my question is, is there a way to avoid that copying, so the DSP reverb only processes specific channels of any given buffer?