# AU plugin sending midi

**URL:** <https://forum.juce.com/t/au-plugin-sending-midi/9089>\
**Category:** General JUCE discussion\
**Created:** [August 9, 2012, 5:44pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089 "2012-08-09T17:44:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [August 9, 2012, 5:44pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/1 "2012-08-09T17:44:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sonic59](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sonic59](https://forum.juce.com/u/sonic59)\
**Post date:** [August 9, 2012, 8:44pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/2 "2012-08-09T20:44:31Z")

</div>

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.

> **[Apple](https://lists.apple.com/archives/coreaudio-api/2007/Mar/msg00053.html)**
>
> Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, and expert device support.

  

> **[Apple](https://lists.apple.com/archives/coreaudio-api/2011/Feb/msg00109.html)**
>
> Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, and expert device support.

---

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [August 10, 2012, 8:36pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/3 "2012-08-10T20:36:11Z")

</div>

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]
```

---

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [August 10, 2012, 8:41pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/4 "2012-08-10T20:41:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DavidCNAntonia](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/davidcnantonia/32/3293_2.png) [@DavidCNAntonia](https://forum.juce.com/u/DavidCNAntonia)\
**Post date:** [September 17, 2021, 11:45am UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/5 "2021-09-17T11:45:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dodothedreamer](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@dodothedreamer](https://forum.juce.com/u/dodothedreamer)\
**Post date:** [November 9, 2021, 1:20pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/6 "2021-11-09T13:20:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [November 9, 2021, 2:18pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/7 "2021-11-09T14:18:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dodothedreamer](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@dodothedreamer](https://forum.juce.com/u/dodothedreamer)\
**Post date:** [November 9, 2021, 3:02pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/8 "2021-11-09T15:02:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [November 9, 2021, 7:46pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/9 "2021-11-09T19:46:47Z")

</div>

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.

 ![Screenshot 2021-11-09 at 19.42.43](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/7/7cacb4f3eaf5c7f8564d7c10798275fe5ac4d55f.png)

---

<div class="post-metadata">

**Author:** ![dodothedreamer](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@dodothedreamer](https://forum.juce.com/u/dodothedreamer)\
**Post date:** [November 9, 2021, 8:55pm UTC](https://forum.juce.com/t/au-plugin-sending-midi/9089/10 "2021-11-09T20:55:13Z")

</div>

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