I’m almost sure that a cast of const float* bufferData is not the solution here. Adding a write option as const float* bufferwriteData = buffer.getWritePointer(channel); is not a possible way as it is used unprocessed somewhere else. a duplicate of this to a read/writable buffer is possible the best candidate?
As a retiree, I’m uncertain what the best approach is after many days of considerations (while relearning C++) without having workable conclusions spinning in my head.
thanks Daniel,
Th problem is that the buffer is going to be overwritten. a second kind of scratch buffer that’s offered to the filldelaybuffer would prevent that.
I am not sure if I understand the problem, but the getReadPointer(channel) and getWritePointer(channel) point to the same address, just one is writeable and the other isn’t.
If you need a place to copy the audio data to, you need to add an juce::AudioBuffer as member to your processor and allocate a buffer in a suited size in your prepareToPlay() method.
Note that processSingleSampleRaw takes in a single float variable and returns a single float variable, it doesn’t work with pointers. You could dereference the pointer, though, like :
Main problem is avoiding a replica of the buffer in the processblock due to time-impact on that copy process. Having that buffer being overwritten is not my goal as this is to be kept as-is. Thanks!
Daniel,
First a big thanks for the great hints you’ve given! My last question…
I’ve successfully duplicated the buffer and started to apply the filter to both channels. Would it be better to apply the filter to each channel separately to avoid artifacts? Also, would a duplicated buffer the best way forward or would you suggest a different approach when applying a filter?