Br: auv3 + midi out doesn't pass auvaltool on macos 12

I’ve investigated this a bit now, testing on Catalina (Intel) and Monterey (Arm).

When the plugin’s main type is MusicDevice, then validation succeeds on Catalina but fails on Monterey.
When the plugin’s main type is MidiEffect, then the validation succeeds on both platforms.
Finally, if I modify the AUv3 wrapper so that it never calls MIDIOutputEventBlock or tries to send MIDI, but keep everything else the same (i.e. it still declares that it wants MIDI in and out, and has a type of MusicDevice), then validation succeeds on Monterey again.

At the moment, I’m inclined to think this is a bug in auval. To check this hypothesis, I tested a non-JUCE-based plugin, specifically the “IPlugInstrument” plugin from the iPlug2 project. This plugin is also a MusicDevice with a MIDI in and out. When built as an AUv3, it fails auval in exactly the same way as the JUCE plugin:

Test MIDI
ERROR: -66745 IN CALL AudioUnitRender

* * FAIL
--------------------------------------------------
AU VALIDATION FAILED: CORRECT THE ERRORS ABOVE.
--------------------------------------------------

It looks like the MIDI output block is faulty in some way and causes the plugin process to crash during the call, causing auval to timeout.

I’ll create a feedback assistant ticket for this issue tomorrow.