[ardour-dev] Mackie protocol and MIDI::Port

Jesse Chappell jesse at essej.net
Sat Dec 23 07:57:37 PST 2006


On 12/23/06, John Anderson <ardour at semiosix.com> wrote:

> The library loads in ardour and displays "Mackie" in the menu. I've
> started writing some code to handle the host initialisation sysex
> messages for the Mackie protocol, using MIDI::Port. Calls to write(...)
> work OK. At this point in the ruby script, reading from the port gives
> the expected response. But trying to call read(...) on the instance of
> MIDI::Port always returns -1.

I'll have to get back to you on this later, unless you figure it out
first.  Turn on trace midi input option and see if anything shows up
on the terminal.

> There are a bunch of signals in MIDI::Port that look like they might be
> useful for handling fader and pot and button messages. For the host
> initialisation sysex messages I'd rather just do simple sends and
> receives.

Yes, and there are also signals for recv'ing sysex messages which you
should use too.  For sending, doing a write is fine.  However, I would
try to separate the MC protocol stuff into a separate class that
encapsulates the midi communication, providing signals for incoming
events, and methods for sending outgoing commands to the surface.
This serves dual purposes of making the main control surface class
easier to read, and also gives other developers (for other projects) a
nice class they can reuse easier to talk with MCs.

> So in short, I need some help understanding the thinking behind
> MIDI::Port.

Pretty much, when you call read on a port, the parser is called and
sigc++ signals are emitted as appropriate.  The write side should be
pretty normal.

jlc



More information about the Ardour-Dev mailing list