Record injected MIDI messages

No, sorry we don’t have an example of this as it’s a bit of a niche use case.

I think this post is the best example:

That topic is a bit confusing as it switches between exposing ports to the OS and creating “virtual” devices inside the engine. If you want to do the latter, VirtualMidiInputDevice is probably the best way to go and send MIDI messages to it as above.

Be careful using getDefaultMidiInDevice, there is likely to already be a default MIDI device so you might want to improve the logic here. It all depends if you’re loading saved settings with a virtual MIDI input already created etc.