Comparison of MIDI Libraries
Chris Ahlstrom
2016-10-25 to 2016-12-04

Currently, Sequencer64 supports two forms of MIDI buss APIs:

    -   ALSA
    -   PortMidi
        -   ALSA
        -   OSX CoreMidi
        -   Windows MME

We would like to support JACK, and there seems to be at least two ways to
do it:

    -   JACK API
    -   RtMidi
        -   Linux
            -   JACK
            -   ALSA
        -   OSX
            -   JACK
            -   CoreMidi
        -   Windows MME

So we are considering leaving PortMidi alone and recreating the MIDI buss
suport using RtMidi.  Here is a feature matrix based on what is already in
use in Sequencer64.

        Feature                   ALSA      PortMidi    RtMidi
        =======                   ====      ========    ======

midibus:

        ID                          x          x
        Clock type                  x          x
        PPQN                        x
        Sequence client             x
        Dest client addr/port       x
        Local client addr/port      x
        Queue (ID)                  x
        Buss name                   x          x
        Last tick                   x          x
        Mutex                       x          x
        Initialize input            x          x
        Initialize output           x          x
        Sysex support               x          x
        Start                       x          x
        Stop                        x          x
        Clock Init                             x
        Clock                       x          x
        Continue                    x          x
        Flush                                  x
        PortMidi stream                        x
        PortMidi number                        x

master-
midibus:

        BPM                         x          x
        PPQN                        x          x
        Sequence client             x          x
        Queue (ID)                  x
        Mutex                       x          x
        Max. busses                 x
        Input busses                x          x
            Active flag             x          x
            Init flag               x          x
            Input init flag         x
        Output busses               x          x
            Active flag             x          x
            Init flag               x
        Channel filtering           x
        Clock Init                             x

PortMidi port enumeration:

    One thing we need to document is how PortMidi enumerates ALSA devices.
    If we run seq64portmidi in "auto" (not manual) mode, our debug output
    shows:

    [ALSA device 0: Midi Through Port-0 in:0 out:1
    [ALSA device 1: Midi Through Port-0 in:1 out:0
    [ALSA device 2: TiMidity port 0 in:0 out:1
    [ALSA device 3: TiMidity port 1 in:0 out:1
    [ALSA device 4: TiMidity port 2 in:0 out:1
    [ALSA device 5: TiMidity port 3 in:0 out:1

    But in the MIDI Clock (i.e. MIDI output) page, we see:

    [0] 0:0 Midi Through Port-0
    [1] 1:2 TiMidty port 0
    [2] 2:3 TiMidty port 0
    [3] 3:4 TiMidty port 0
    [4] 4:5 TiMidty port 0

    Where is the ":1" entry?  It is on the MIDI Input page:

    [0] 0:1 Midi Through Port-0


# vim: sw=4 ts=4 wm=8 et ft=sh
