[LAD] making sense of Jack MIDI; or, is this an appropriate use for Jack?

James Morris james at jwm-art.net
Sat Feb 16 00:45:27 UTC 2013

On 15/02/13 M Donalies <ingeniousnebbish at cox.net> wrote:
>On Friday 15 February 2013 13:19:57 J. Liles wrote:
>> It means that you have to do that tricky 'sequencing' part, which
>> consists of scheduling (MIDI) events and only placing them onto the
>> JACK buffer at the appropriate instant. ALSA MIDI does this for you,
>> as well as providing a nice API for generating the MIDI events.
>> That's not the trickiest part though, the real mess begins when you
>> want to deal with the JACK Transport/Timebase API to follow or
>> generate tempo changes.
>So there's no way to tell Jack to deliver the event at time t? You
>have to wait for the right frame and then put on the buffer
>(presumably to appear on the buffer for the receiver to use the next
>Unless you mean something other than conversions to/from nanoseconds
>(or whatever), the tempo stuff doesn't much concern me. That's a
>straight-forward number-crunching algorithm. That kind of thing I can

I expected the timebase stuff to be quite straightforward too, but found
the details started to get a bit fuzzy when it comes to staying in sync
as master and staying in sync as a slave; something to do with rounding
errors and methods of calculation. Found it actually quite difficult,
and with my program I don't think I actually came to find anything I
considered a fully acceptable solution. (but coding is just a hobby for
me that sometimes I get quite serious about and at other times (like the
past six months or so) just can't be bothered with).

But anyway, JACK MIDI isn't very difficult, NON Sequencer was one of
the programs I found useful to study, perhaps you could take something
from JACK Keyboard or VMPK, too.


More information about the Linux-audio-dev mailing list