Hi guys,
this is my first post in the forum; I’m quite new to JUCE, so maybe my issue is quite easy for an experienced JUCE programmer, but for me at the moment is quite difficult to understand where is the trick that causes things to work properly (or maybe I didn’t understand nothing at all and what I’m trying to do is not possible…)
I’m using Juce 6.1.4 free edition on Linux.
By reading the official JUCE documentation, it seems possible in Linux (and also on Mac) for one juce application send midi messages to another juce application by using virtual midi ports. Infact the documentation for MidiOutput::createNewDevice states:
“This will attempt to create a new midi output device with the specified name that other apps can connect to and use as their midi input.”
To be honest this sentence leaves me a little bit confused: how can an application connect to a midi output port to get midi messages from it, i.e. use it as a midi input port? To read midi messages one usually connects to a midi input port…
Anyway, let’s call the midi message producer application A, and the midi message consumer application B.
In A I successfully create a virtual midi output port (whose name is “vmidi”) with the static public method createNewDevice of the MidiOutput class; then I periodically send midi messages to it via the sendMessageNow method and it all seems to work by the producer side…
Now my doubt…
The virtual midi port created in A is an output port, so I can send midi messages to it, but where do these message go? How can I read the messages sent to that port? (which is waht I would like application B were able to do…).
To solve this question, what I tried in application B (the consumer) was:
I created a new virtual input midi port with the same “vmidi” name as the virtual output midi port by using the public static MidiInput::createNewDevice method; the port was created without errors; then I started the midi input port in the hope that the messages written by the application A were read by the registered midi callback in application B, but nothing happens: the midi messages that A sends to virtual output midi port “vmidi” do not magically appear in the virtual input midi port “vmidi” for the application B to be read…
What lacks to my understanding is how can I manage to have the midi messages written to a virtual midi output port by an application appear in another virtual midi input port to be read by another application…
The final goal is to have a chain of midi applications that send a stream of midi messages to one another, each application possibly performing some filtering and transformation on the midi messasges read before forwarding them to the following application in the chain…
Excuse me for having been so verbose, but I wanted to explain precisely the problem I’m trying to solve…
Luca