Hi Im Im trying to use ProcessContextNonReplacing as I have a number of different channels that need to process the input data independently them mix them together.
I have a buffer for each channel, I then construct a ProcessContextNonReplacing using the buffer as input and one of the channel buffers as output. Finally I mix them all together using a ProcessContextNonReplacing comprising of each channel as the input then the buffer as the output. The final step is another processor that does a little eq which uses the ProcessContextReplacing with just the buffer.
During testing only the final eq part seem to be processed all the channel processing using the ProcessContextNonReplacing seem to be not working, they are just acting like a pass through?
Here is a snippet of code of how Im constructing the ProcessContextNonReplacing parts, I I swap this to a ProcessContextReplacing and copy to and from buffers things seem to work ok but obviously thats a lot of copying that I should not need to do if I can get ProcessContextNonReplacing working:
void processBlock(AudioBuffer<float> &buffer, MidiBuffer &midiMessages) override {
using namespace dsp;
ScopedNoDenormals noDenormals;
juce::ignoreUnused(midiMessages);
...
dsp::AudioBlock<float> inputAudioBlock(buffer);
dsp::AudioBlock<float> outputBlock(buffer1); //buffer1 is a field in this class
dsp::ProcessContextNonReplacing<float> nonReplacingContext(inputAudioBlock, outputBlock);
channel1processor.process(nonReplacingContext);
I have also tried just using the read/write pointers too:
const auto numberOfChannels = (size_t) jmin(buffer1.getNumChannels(), buffer.getNumChannels(), buffer.getNumChannels());
const auto L = (size_t) buffer.getNumSamples();
AudioBlock<const float> inputAudioBlock(buffer.getArrayOfReadPointers(), numberOfChannels, L);
AudioBlock<float> outputAudioBlock(buffer1.getArrayOfWritePointers(), numberOfChannels, L);
ProcessContextNonReplacing<float> channelContext(inputAudioBlock, outputAudioBlock);
channel1Processor.process(channelContext);
Am I doing something stupid that I just cant see?
If I do a manual copy and use a ProcessContextReplacing like this, then the processors in the channel processor work:
buffer1.copyFrom(0,0, buffer, 0, 0, buffer.getNumSamples());
buffer1.copyFrom(1,0, buffer, 1, 0, buffer.getNumSamples());
dsp::AudioBlock<float> outputBlock(buffer1);
dsp::ProcessContextReplacing<float> channelContext(outputBlock);
Help!