AU plugin sending midi

Is it still the case that Audiounits can’t send midi out? It certainly seems so.

And … that being the case … is it a reasonable workaround to use a system level MidiOuput from within a plugin? I’ve built a couple plugins that do this, and they seem to work fine, but is certainly unconventional.

Based on the links below, I’m pretty sure AudioUnits can send midi out. Not sure if it has been implemented in Juce’s AU plugin wrapper though.
It’s just that no AU hosts support it.


Hmmm … I’m guessing JUCE doesn’t support it then?!
The Juce host see’s the plugin with no midi output (the VST version has the midioutputs, of course).

Jules - ???

I’ve set the pluginType to kAudioUnitType_MusicEffect, and JucePlugin_ProducesMidiOutput to 1. Still, the plugin shows no midi outputs.

from Juce_AU_wrapper.mm - within the callback … should this be copying the midi to an output buffer perhaps, or is there just the one buffer?

[code]
if (! midiEvents.isEmpty())
{
#if JucePlugin_ProducesMidiOutput
const juce::uint8* midiEventData;
int midiEventSize, midiEventPosition;
MidiBuffer::Iterator i (midiEvents);

            while (i.getNextEvent (midiEventData, midiEventSize, midiEventPosition))
            {
                jassert (isPositiveAndBelow (midiEventPosition, (int) numSamples));



                //xxx
            }
           #else
            // if your plugin creates midi messages, you'll need to set
            // the JucePlugin_ProducesMidiOutput macro to 1 in your
            // JucePluginCharacteristics.h file
            //jassert (midiEvents.getNumEvents() <= numMidiEventsComingIn);
           #endif

            midiEvents.clear();
        }[/code]

And yeah - is it seriously the case that there are NO hosts that support kAudioUnitProperty_MIDIOutputCallback? That’s hard to believe.

And … is it a reasonable alternative to initiate a system level midi connection (as you would do from a standalone program) for an AU plugin then? It seems to function fine, but is unconventional I assume.

I’m facing the same problem as you. The VST3 seems to be working fine sending and receiving MIDI but the AU seems to be only capable of receiving MIDI. I have implemented juce::MidiOutput::createNewDevice() as a workaround which is working and isn’t seeming to cause any problems as far as I can tell. It may not be the best thing to use as I believe its system level but I think it’s the only way to get the required functionality to work in AU as far as I can tell. If you’re still about on the forum, did you come to a better solution?

Also, is anyone else aware of any other workarounds or have reasons not to use MidiOutput that outweigh the importance of core functionality?

Same issue here. AU plugin doesn’t send MIDI using JUCE 6.1.

Have you enabled “Plugin MIDI Output” in the Plugin Characteristics field in your Projucer project?

Yes. Also it does send MIDI with VST and VST3.

Here, when I build the AudioPluginDemo as an AU and host it in the AudioPluginHost, I can see that it sends out all of the messages that it receives correctly (i.e. the midi output functions as expected).

What host are you using to test your AudioUnit?

I’d recommend testing your AudioUnit in the AudioPluginHost and seeing whether it produces MIDI correctly there. If it does, then the problem is probably with the host that you’re using, rather than in JUCE or your plugin.

You are right! The problem was with Reaper, it does not support sending MIDI from AU plugins.