[ardour-dev] Mackie protocol
Jesse Chappell
jesse at essej.net
Wed Jan 3 11:50:14 PST 2007
On 1/3/07, John Anderson <ardour at semiosix.com> wrote:
> > as jesse said, i would focus on wrapping the MC sysex messages in
> > sigc::signal so that the code that actually responds to a given message
> > doesn't know that it was delivered via MIDI, just that "it arrived".
>
> It was a wee bit annoying using signals for the initialisation where
> there are a couple of request/responses that need to be sent in
> sequence. Anyways, it's done now. And signals are of course a good match
> for all the other midi messages.
You don't need to match every exact sysex message with a signal in
your protocol wrapper class, just make signals for the logical
elements that you might use from the surface class. If initialization
is multi-step, then encapsulate that if appropriate....
> * Out of curiosity mostly - where is the thread that does the reading of
> the port? I was kinda surprised that it was emitting signals without
> calls to Port::read().
Depends where you got the port, and on what platform you're on. In
your case you might have been using the port that is set as the midi
port in ardour, in which case there is a thread running from
session_midi.cc that services it and calls read. On OS X, the
coremidi port type actually directly calls the parser because coremidi
defines its own thread for it. I was thinking that we may actually
want to create a new port (or ports, considering we might have
multiple MC units ganged together) for this surface separate from the
control port that the generic midi control surface uses. In that
case, you'll need a thread and select/poll loop like the one in
session_midi.cc which is active on non-OS X platforms. It really is
kind of a mess.
jlc
More information about the Ardour-Dev
mailing list