Hey All,
I’ve been using the AudioProcessorGraph with no problems and have been loving the class, however I’ve hit some issues today with offline rendering.
It appears this issues stem from the Async methods the graph uses to initialize it’s internals.
When Ableton switches the graph to offline mode and back, it appears the async messages are triggering at the incorrect times or something of the sort.
Has anyone else faced these issues in offline rendering with the audiograph?
My prepare to play looks like such:
void APPAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
{
mAudioGraph->setPlayConfigDetails(getMainBusNumInputChannels(),
getMainBusNumOutputChannels(),
sampleRate, samplesPerBlock);
mAudioGraph->prepareToPlay(sampleRate, samplesPerBlock);
mAudioGraph->initializeGraph();
}
And my process block:
void APPAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
{
ScopedNoDenormals noDenormals;
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
mAudioGraph->updatePlayhead(getPlayHead());
mAudioGraph->processBlock(buffer, midiMessages);
}
Inside of that initializeGraph functions a few things happen.
The graph is first cleared, then the nodes are added, then parameter pointers are placed into the nodes for access to application parameters, and finally a set of default connections are created for audio playback.
Like I said this has all been working wonderfully except for offline mode.
If I don’t get a crash, I get a pocket of unprocessed audio at the start of the offline render, which sounds as though the graph is waiting for the async update to happen, and it didn’t process the audio at all.
I’ve tried swapping the order of things around a bit but to no success. Thanks for any tips!
Best,
J