Quote:
Originally Posted by mviljamaa
Changing Reapers buffer from 1024 -> 512 shifts the data[0]=0.0 point in the recording to the left by 512.
|
I have just tried myself, and changing REAPER's audio buffer size doesn't change the position of data[0], so your/mine/our code seems to be working fine. It does depend on clearing queues in Reset(), because else the posisiton of the first data[0] is semi-random. This is because immediately after loading your plug-in the host starts processing it, and most hosts will just keep on processing continuously, whether you start/stop playback or not. This is why you
might want to clear queues on playback, but you don't
need to. Note that probably not all hosts will call Reset() on playback. But I guess the exact position of data[0] samples isn't important anyway, as long as they are FFT_BUFFER_SIZE samples apart.
Quote:
Originally Posted by mviljamaa
No, how to do it? I mean, what input, what output?
|
Code:
void MyPlug::Reset()
{
TRACE; IMutexLock lock(this);
// Clear input queue.
processingBuffer.Clear();
// Clear output queue.
outputBuffer.Clear();
// Pre-add silence to output queue.
outputBuffer.Add(NULL, sizeof(double)*FFT_BUFFER_SIZE);
}