Handling midi events from Ableton Live with an Audio Application

Thanks for your answer. I will try that.

I am still wondering why other applications that I use can be seen directly by Live as a “device” (with the “MIDI TO” menu) but not mine.
Is there a way to permanently declare a JUCE application as a midi device?

EDIT: To be more precise: in Apple Core Midi, there is a MIDIClientCreate function, that allows to declare the application as a midi device. Is there an equivalent in JUCE?

EDIT2: It seems I have to open virtual midi ports in the application: https://forum.juce.com/t/virtual-midi-ports/16596