AU Host: AudioUnitPluginInstance does not implement reset(), so AudioProcessor::reset() on a hosted AudioUnit does nothing
Detailed steps on how to reproduce the bug
- Host any AudioUnit that carries state between blocks, a compressor for example, through
AudioPluginFormatManageron macOS. - Drive it hot for a while, then call
reset()on theAudioPluginInstanceand render a quiet passage. - Do the same with the VST3 build of the same plugin.
What is the expected behaviour?
AudioProcessor::reset() on a hosted instance brings the plugin back to rest: the VST3 host implements it (juce_VST3PluginFormatImpl.h, VST3PluginInstance::reset(), which stops processing, deactivates, reactivates, and restarts, so a JUCE plugin's own reset() and prepareToPlay run), and an AudioUnit has AudioUnitReset for the same purpose. The two formats should agree.
What is the actual behaviour?
AudioUnitPluginInstance in modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatImpl.h never overrides reset(), so the call is the base class's no-op and the AudioUnit keeps whatever it was doing. releaseResources() already makes the calls that would reset it (AudioUnitReset on the global scope, then on every input and output bus in resetBuses()), so the override is those same calls guarded by prepared.
Seen from a measurement host that renders a compressor's gain ladder fresh and again after two seconds at full scale and a reset(): through AU the first rungs of the second ladder were measured while the compressor was still releasing from the first ladder's top, through VST3 they matched the first ladder. With the override below, the AU rungs match too.
void reset() override
{
if (prepared)
{
AudioUnitReset (audioUnit, kAudioUnitScope_Global, 0);
resetBuses();
}
}Pull request to follow.
Operating systems
macOS
What versions of the operating systems?
macOS 15
Architectures
ARM
Stacktrace
None; nothing crashes.
Plug-in formats (if applicable)
AU (hosting)
Plug-in host applications (DAWs) (if applicable)
A JUCE host built on AudioPluginFormatManager.
Testing on the develop branch
The bug is present on the develop branch (72782788c, 9.0.2)
Code of Conduct
- I agree to follow the Code of Conduct
Source: juce-framework/JUCE