<br><div class="gmail_quote">On Wed, Dec 28, 2011 at 11:35 AM, Paul Davis <span dir="ltr"><<a href="mailto:paul@linuxaudiosystems.com">paul@linuxaudiosystems.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">On Wed, Dec 28, 2011 at 1:46 PM, Iain Duncan <<a href="mailto:iainduncanlists@gmail.com">iainduncanlists@gmail.com</a>> wrote:<br>
> Hey folks, what is the easiest way to deal with midi input in a jack app?<br>
> I'm confused by the difference in jack midi and alsa midi, because I have<br>
> two midi inputs, one is a usb input, so it appears at a low level as an alsa<br>
> device, but the other is the midi input on a firewire unit, and it appears<br>
> as a jack midi device. I'd like to make sure that whatever I do is easy to<br>
> port to other systems. Does it make sense to use portmidi or rtmidi to get<br>
> input or should I stick to the jack api entirely?<br>
<br>
</div></div>JACK's MIDI API is substantially different from all others in that you<br>
receive MIDI data in the same thread (and same callback) that you<br>
receive audio data. In this sense its much more like the APIs used by<br>
plugin APIs to retrieve MIDI for use during the plugin API's<br>
equivalent of JACK's process() call.<br>
<br>
None of the other APIs that you've mentioned have this property, and<br>
nor do any of the Windows MIDI APIs or CoreMIDI.<br>
<br>
this means that you face opposing issues depending on which API you<br>
choose to use:<br>
<br>
  * if you use JACK:<br>
        - MIDI data is trivially available to alter synthesis done<br>
during process()<br>
        - MIDI data needs to be moved across thread boundaries to be<br>
useful outside of process()<br>
<br>
  * if you use ALSA, portmidi, rtmidi, CoreMIDI or anything else<br>
       - MIDI data to be used for synthesis has to be moved across<br>
thread boundaries<br>
       - MIDI data used for other purposes can often be used in the<br>
same thread it was received in,<br>
                 though not always.<br>
<br>
this issue is far more substantive than the question of whether you<br>
can access a firewire-based MIDI port or a USB-based MIDI port.<br>
<font color="#888888"><br></font></blockquote><div><br></div><div>Thanks for that explanation. In my case, I believe I will have two kinds of midi input, one that would be best served by the first set of tradeoffs and the other the second, namely, the user may be playing a synth, or the midi input may be used to control the app. Is it reasonable to use both jack midi and a non-jack midi api in the same app with different midi input devices?</div>
<div><br></div><div>thanks</div><div>Iain </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font color="#888888">
--p<br>
</font></blockquote></div><br>