Receiving multiple MIDI inputs from Ableton

Hello fellow Jucers,
I’m trying to build a VST3 that receives multiple tracks MIDI inputs from Ableton in such a way that I can recognize what are the notes associated to each track. What I’m getting now it’s a mix of every MIDI note on/off:

processBlock :: Got message from keyboard: Note on C1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 57 Channel 1
processBlock :: Got message from keyboard: Note off C1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 116 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C#1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 56 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 50 Channel 1
processBlock :: Got message from keyboard: Note off C1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off C#1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C1 Velocity 65 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 34 Channel 1
processBlock :: Got message from keyboard: Note off C1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C#1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 27 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C1 Velocity 51 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 76 Channel 1
processBlock :: Got message from keyboard: Note off C1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off C#1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 120 Channel 1
processBlock :: Got message from keyboard: Note off C1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 82 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C#1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on C1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 84 Channel 1
processBlock :: Got message from keyboard: Note off C1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 120 Channel 1
processBlock :: Got message from keyboard: Note off C#1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on C1 Velocity 100 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 28 Channel 1
processBlock :: Got message from keyboard: Note off C1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note off D1 Velocity 64 Channel 1
processBlock :: Got message from keyboard: Note on D1 Velocity 84 Channel 1

Is there a way to do it? thanks!

I don’t think there is a way to get this information. We receive pure MIDI message bytes in JUCE and something like a source is not included in the normal MIDI protocol as far as I know.

MIDI has the channel information to solve that issue. You can send MIDI messages on different channels (1-16).

Ableton doesn’t handle MIDI input with multiple channels. They are all read as channel 1 regardless of which plugin format you are using.

unfortunately not available in FL Studio. there you can only send 1 MIDI channel to a plugin’s MIDI input

Ableton sends midi on all channels but it has to be armed to send midi events with keyboard I believe . So which track is armed with the keyboard

Could you elaborate more please? What I’m doing now is receiving MIDI input from a track where I have an instrument rack with multiple drums, into a track where I place my VST3.

Even if you have a keyboard sending multiple channels, you have to route each channel to a separate MIDI track.

Also, the MIDI channels in the output of a plugin can’t be sent to different tracks unlike Studio One.

In other words, you can’t use a pure MIDI multi track sequencer plugin inside Ableton. You have to host the plugins needed to render each MIDI channel inside your MIDI multi track sequencer plugin and send the audio of each channel to separate Ableton tracks. I use Element for that last part.

PS. Now that Studio One 7 has added a MIDI launcher, there is less pressure to use Ableton though.

Alright thank you everyone, this basically means I’m f****d right?

there are DAWs that let plugins receive and recognize MIDI from multiple MIDI channels, like Cubase and Bitwig. The latter even has great workflows for working with MIDI in general so plugins like that are always appreciated

Okay might not be the best solution but specifically for live max msp they have an API maybe you can use to determine which track it’s coming from. not a universal solution though . I don’t think you would have juce plugin anymore

Or else you would have to tell your user to specify a midi channel 1-16 and that’s how you can separate them

Thanks, but do you know how to specify the MIDI output channel for a track on Ableton? I’m not sure it is possible.

Under the output device selector there’ll be a channel selector where you can select the output channel.

The only way to receive/send MIDI on multiple channels inside Ableton is to have your plugin open the MIDI port directly and not rely on routing in Ableton. You can however use a mixture of a plugin and M4L inside ableton to achieve the same thing.