Re: [LAD] handling midi input in a jack app?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <iainduncanlists@...>, <linux-audio-dev@...>
Date: Wednesday, December 28, 2011 - 8:01 pm

--_5baa786c-9530-4361-9c96-8e60f240c044_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

On Wed=2C Dec 28=2C 2011 at 1:46 PM=2C Iain Duncan wrote:

p?
Dave mentioned that you want to use the Jack API entirely=2C I think he pro=
bably meant

that on Linux you can safely rely in having an access method that just take=
s MIDI=20

from Jack - then converts to whatever messaging you want within your app. I=
may

be wrong. The issue is that you put in that extremely awkward caveat which =
was "easy=20
to port to other systems". I would not really want to have my whole source =
code having=20
a line like #include to work. Even if that line is in a p=
rivate=2C global=20
header file it implies the code is dependent and that reduces portability.

If you want maximum portability you probably need to create your own intern=
al
event messaging format and have raw MIDI=2C ALSA MIDI=2C Jack MIDI (or OSC=
=2C or
Portmidi=2C etc) map into it using libraries.

It is a bit more work but fortunately there is a reasonable amount of commo=
nality
in the external formats so your library will mostly be concerned with what =
is the
access method to those data formats rather than the format itself.

Not sure if that answers your question. You asked what was the easiest way.=
The
easiest way is get somebody else do to it but I think your own your own her=
e? The
main thing you want to avoid is that when you pass these 'musical event' me=
ssages
around your application that you are relying on a format from somebody else=
' library
since if you try and port that over to another system you will have a depen=
dency on
what might be a non-native interface on that other system.

If you are going to support lots of different interfaces then you get into =
some really=20
enjoyable special cases. For example=2C when MIDI is not delivered into the=
RT audio
thread you need a ringbuffer to send at least some of the messages to that =
thread.
Conversely when you use Jack you have to decide which messages are not real=
ly for
the RT thread and throw them the other way on another such ringbuffer. When=
you
talk about having multiple MIDI interfaces you will be directly affect by t=
hese issues
at the same time.

> what is the easiest way to deal with midi input in a jack app?

Hm=2C there might not actually be an answer to this question since you put =
in that=20
damn caveat - you don't actually seem to want a Jack application.=20

Have fun. Or=2C if you can=2C get somebody else to have that 'fun' for you.

Kind regards=2C nick.

"we have to make sure the old choice [Windows] doesn't disappear=94.
Jim Wong=2C president of IT products=2C Acer

Date: Wed=2C 28 Dec 2011 10:46:29 -0800
From: iainduncanlists@gmail.com
To: linux-audio-dev@lists.linuxaudio.org
Subject: [LAD] handling midi input in a jack app?

Hey folks=2C what is the easiest way to deal with midi input in a jack app?=
I'm confused by the difference in jack midi and alsa midi=2C because I hav=
e two midi inputs=2C one is a usb input=2C so it appears at a low level as =
an alsa device=2C but the other is the midi input on a firewire unit=2C and=
it appears as a jack midi device. I'd like to make sure that whatever I do=
is easy to port to other systems. Does it make sense to use portmidi or rt=
midi to get input or should I stick to the jack api entirely?

thanksIain

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev =

--_5baa786c-9530-4361-9c96-8e60f240c044_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

On Wed=2C Dec 28=2C 2011 at 1:46 PM=2C Iain Duncan &lt=3Biainduncanlis=
ts@gmail.com&gt=3B wrote:&gt=3B Hey folks=2C what is the easiest way to=
deal with midi input in a jack app?Dave mentioned that you want =
to use the Jack API entirely=2C I think he probably meant
that on Linux you can safely rely in having an access method that just take=
s MIDI
from Jack - then converts to whatever messaging you want within your app. I=
may
be wrong. The issue is that you put in that extremely awkward caveat which =
was "easy to port to other systems". I would not really want to have my=
whole source code having a line like #include &lt=3Bjack/midiport.h&gt=
=3B to work. Even if that line is in a private=2C global header file it=
implies the code is dependent and that reduces portability.

If you want maximum portability you probably need to create your own intern=
alevent messaging format and have raw MIDI=2C ALSA MIDI=2C Jack MIDI (o=
r OSC=2C orPortmidi=2C etc) map into it using libraries.It is a=
bit more work but fortunately there is a reasonable amount of commonality<=
br>in the external formats so your library will mostly be concerned with wh=
at is theaccess method to those data formats rather than the format its=
elf.Not sure if that answers your question. You asked what was the =
easiest way. Theeasiest way is get somebody else do to it but I think y=
our own your own here? Themain thing you want to avoid is that when you=
pass these 'musical event' messagesaround your application that you ar=
e relying on a format from somebody else' librarysince if you try and p=
ort that over to another system you will have a dependency onwhat might=
be a non-native interface on that other system.If you are going to=
support lots of different interfaces then you get into some really enj=
oyable special cases. For example=2C when MIDI is not delivered into the RT=
audiothread you need a ringbuffer to send at least some of the message=
s to that thread.Conversely when you use Jack you have to decide which =
messages are not really forthe RT thread and throw them the other way o=
n another such ringbuffer. When youtalk about having multiple MIDI inte=
rfaces you will be directly affect by these issuesat the same time.=
&gt=3B what is the easiest way to deal with midi input in a jack app?Hm=2C there might not actually be an answer to this question since yo=
u put in that damn caveat - you don't actually seem to want a Jack appl=
ication. Have fun. Or=2C if you can=2C get somebody else to have th=
at 'fun' for you.Kind regards=2C nick."we have to make sure=
the old choice [Windows] doesn't disappear=94.Jim Wong=2C president of=
IT products=2C Acer=
Date: Wed=2C 28 Dec 2011 10:46:29 -0800From: ia=
induncanlists@gmail.comTo: linux-audio-dev@lists.linuxaudio.orgSubj=
ect: [LAD] handling midi input in a jack app?Hey folks=2C what=
is the easiest way to deal with midi input in a jack app? I'm confused by =
the difference in jack midi and alsa midi=2C because I have two midi inputs=
=2C one is a usb input=2C so it appears at a low level as an alsa device=2C=
but the other is the midi input on a firewire unit=2C and it appears as a =
jack midi device. I'd like to make sure that whatever I do is easy to port =
to other systems. Does it make sense to use portmidi or rtmidi to get input=
or should I stick to the jack api entirely?
thanksIain
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev
=

--_5baa786c-9530-4361-9c96-8e60f240c044_--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] handling midi input in a jack app?, Iain Duncan, (Wed Dec 28, 6:46 pm)
Re: [LAD] handling midi input in a jack app?, Nick Copeland, (Wed Dec 28, 8:01 pm)
Re: [LAD] handling midi input in a jack app?, Paul Davis, (Wed Dec 28, 7:35 pm)
Re: [LAD] handling midi input in a jack app?, David Robillard, (Wed Dec 28, 8:05 pm)
Re: [LAD] handling midi input in a jack app?, Iain Duncan, (Wed Dec 28, 8:59 pm)
Re: [LAD] handling midi input in a jack app?, Iain Duncan, (Wed Dec 28, 7:54 pm)
Re: [LAD] handling midi input in a jack app?, Paul Davis, (Wed Dec 28, 7:59 pm)
Re: [LAD] handling midi input in a jack app?, David Robillard, (Wed Dec 28, 7:35 pm)