Added virtual port / MIDIDestinationCreate feature#36
Added virtual port / MIDIDestinationCreate feature#36nsowen wants to merge 3 commits intoDerekCook:masterfrom
Conversation
|
Apologies for the delay in replying, life is manic. Thanks for the comments on CoreMIDI4J and providing the suggested change. I'm a bit nervous when you mention the breaking of APIs whether or not that breaks CoreMIDI4J working with our applications, so we need to be a little cautious. Whilst you also mention taking the least invasive approach, that still makes me nervous! It's a bit hard to see at a glance what all the changes are, so will need to work through it in slower time when we get a chance. It might be useful if you can provide as a use case of what you are trying to achieve in terms of interapp comms that require a virtual approach, and then perhaps we are in a better position to review your proposed change and if it is the best implementation for that. |
|
Thanks for responding, Derek. I’ve been waiting since this is mostly your project, but my initial reaction was that this is something outside the core purpose of CoreMidi4J, and should probably be handled by a separate project. It is also unclear to me why one would want to not simply use the MIDI IAC mechanism that Apple already offers for this purpose. |
|
Apologies, I lost track of your responses. Thanks for the feedback. Here's my usecase: So, I created a Java App that, while running, opens a Virtual Midi-Input-Port using this extension to CoreMidi4J. I thought, since the CoreMidi API itself provided this API method https://developer.apple.com/documentation/coremidi/1495347-mididestinationcreate Anyway, thanks for responding! |
|
Hi, will take a look some time, but my first observation is that you have used a deprecated function, so maybe it is best to fix that first before we look at it. |
Thanks for CoreMidi4J, it is in fact really nice work and I love using it.
Today I was looking for a Java API for creating virtual MIDI input ports for creating software that can receive MIDI events from other applications without having to use the Apple IAC device.
Unfortunately, this is obviously not supported by the Java Sound API, nor did I find a good and clean way of adding this to CoreMidi4J without breaking with the fundamental APIs. So I decided to take a more hacky, but minimal-invasive approach by simply adding this to the existing CoreMidiInputPort code and use a static method in CoreMidiSource.
Example:
CoreMidiSource virtualDevice = CoreMidiSource.createVirtualDevice("My virtual device");
// no-op here
virtualDevice.open();
// receive MIDI from Logic / MainStage / etc.
// close and do a clean disposal of the destination in CoreMidi
virtualDevice.close();
There are probably other and more better ways of implementing this, but anyway, maybe you will find this useful.
Sorry for the spacing changes, I couldn't keep IntelliJ from fixing the whitespaces.