I need to create a buffer that is larger than the block buffer, fill it up from the smaller block buffers, do some processing, then send it out to be played. Here is a crude diagram:
This should be simple, however, everything I try crashes in AudioMulch.
LargerBuffer and PlaybackBuffer were created as private members of PluginProcessor.h:
Their size is set in prepareToPlay:
In processBlock, LargerBuffer is filled up with the smaller block buffers in until it is full, then the RMS is taken, and the LargerBuffer is copied to PlaybackBuffer. The crashing happens here with the PlaybackBuffer.copyFrom calls, as well as the buffer.copyFrom calls:
The crashing stops if copyFrom is replaced with the following highlighted line, however, this doesn't seem right.
PlaybackBuffer must then be divided into block-sized portions for playback, and nothing prevents the crashing with those copyFrom calls:
In case it might be helpful, here is some of the crash info:
I've tried more things than I care to admit, can anyone shed some light on this?