[gmpi] Re: MIDI: Common event coding

  • From: "Jack O'Quin" <joq@xxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: 23 Jun 2004 16:03:52 -0500

Chris Grigg <gmpi-public@xxxxxxxxxxxxxx> writes:

> See, for Mike the important thing is that the expanded message and
> the stapled MIDI are in sync, have the same info, which I .think. is
> what I showed, I hope, whereas it could be hard to make that promise
> with a free-form message code set -- not just OSC, but any protocol
> with that characteristic.

AFAICT, you have demonstrated that MIDI can exactly encode a proper
subset of GMPI messages.  Given that, it seems cleaner, better and
more powerful *not* to include the equivalent MIDI with every message,
but instead to provide explicit encoding routines in the plugin's
runtime environment...

 int gmpi_encode_midi_exact(gmpi_message_t *msg, char *midi_buf, int buf_len);

 int gmpi_encode_midi_approx(gmpi_message_t *msg, char *midi_buf, int buf_len);

The first would return the equivalent midi byte string only if the
`msg' has an exact MIDI representation.  The second would round
appropriate values to the nearest MIDI equivalent.  We might need to
include several variants or options, depending on the types of
rounding desired.  In either case, a return code would report whether
or not the conversion was successful.

This is more powerful, because it gives the plugin control over what
approximations are desired, and is not limited by the host's view of
which (if any) are appropriate.

It is cleaner, because there is no need to generate MIDI equivalents
for plugins that don't need them.  

And it is better (IMHO), because it gently encourages plugin
developers to focus on the native GMPI representation.
-- 
  joq

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: