AAX Plugin doesn't not receive MIDI input

Hi guys,

My plugin can receive MIDI commands, for example for tap tempo or preset change, and that feature works in every DAW/format except from Pro Tools.

This is the setup:

Basically an audio track for the plugin and a MIDI track for the MIDI controller. The same setup works with other plugins that are clearly made with JUCE. Also if I record some MIDI commands and then press “play”, they are sent to the plugin and actually executed!!

I just can’t understand why recorded messages works but live messages not.

In my CMake I’ve set:

    IS_SYNTH FALSE                              
    NEEDS_MIDI_INPUT TRUE                       
    IS_MIDI_EFFECT FALSE     

because it’s not a synth, it’s not a MIDI effect but needs MIDI input to remotely change presets and so on. The same plugin in AU/VST3 format in other DAWs has no problems at all.

What am I missing? Are there some special flags that needs to be added?

Mmmm, i have a vague memory that sometimes I needed to set something to be a synth even though it wasn’t? I"m guessing, but try it?

Works for us. Only thing I see different is we also have this:
NEEDS_MIDI_OUTPUT FALSE
Don’t know if that would have any bearing, though. Probably the default, anyway.
You have Record-enabled, I see, so that should work.

Thank you @jimc and @HowardAntares, I’ll try both approaches and update the thread!

I’ve tried both approaches (NEEDS_MIDI_OUTPUT FALSE , and IS_SYNTH TRUE), but in both scenarios nothing changed, I still can’t receive MIDI in real time.

Just to recap:

  • The same Pro Tools setup (2 tracks with a send etc) works with third party plugins
  • A recorded MIDI track is correctly sent to my plugin and the MIDI messages are received and executed
  • My plugin has no problems handling MIDI in standalone and/or other DAWs/formats

Given the assumptions above, I can say that my Pro Tools setup and my plugin code are ok, so maybe there is something more that I need to activate in order to receive MIDI in PT also in real time.

I’ve debugged this a bit now. I modified the AudioPlugin CMake example with the following flags:

IS_SYNTH FALSE 
NEEDS_MIDI_INPUT TRUE
NEEDS_MIDI_OUTPUT FALSE
IS_MIDI_EFFECT FALSE
FORMATS AAX AU VST3 Standalone

Then, I added this to the bottom of the processBlock:

const auto gotMessage = [&]
{
    for (const auto& msg : midiMessages)
        if (msg.getMessage().isProgramChange())
            return true;

    return false;
}();

I also modified the editor so that it repainted every time gotMessage becomes true.

I set up MidiWrench on an iPhone as a network MIDI device, and configured one of the dials to send program change messages.

Then, I opened Pro Tools 2023.12 and inserted the Audio Plugin Example on an audio track. I also created a MIDI track, and set the source to Network Session 1, and the destination to Audio Plugin Example 1, Channel 1.

Now, moving the Program Change dial in Midi Wrench causes the editor of the Audio Plugin Example to update, as long as the MIDI channel has Track Record Enabled, and Record Enable is selected in the main transport.

What exactly are the MIDI messages you expect to receive? There’s no standard tap tempo message, so are you using note-ons or some other message? To change presets, are you sending Program Change and/or using Bank Select, or something else?

Have you tried checking (in a debugger, or by logging to file, etc) whether the messages are received in your processBlock? I wonder whether it’s possible that the messages are received, but something’s going wrong later on when processing the messages.

Did you try an instrument track instead of a midi track?

Thank you Reuk, I found the issue!

When I saw your code I finally understood where was the problem, and I’ve changed my code from this:

internalMidiBuffer.addEvents(midiMessages, midiMessages.getFirstEventTime(), midiMessages.getLastEventTime(), 0);

To this:

        int midiMsgIdx = 0;
        for (const auto& msg : midiMessages) 
        {
            internalMidiBuffer.addEvent(msg.getMessage(), midiMsgIdx);
            midiMsgIdx++;
        }

(just a mockup, I will write it better)

basically the problem is that AUv3 and AAX timestamps cannot be trusted, and my previous implementation was ignoring the messages because they were somehow outside the range “firstEventTime” and “lastEventTime”. That code snippet was absolutely fine in Standalone/AU/VST3 so I looked for the issue elsewhere.

Thank you again, I really appreciated.

1 Like