[gmpi] Re: MIDI: Common event coding

On Wed, Jun 23, 2004 at 10:27:52AM -0700, Chris Grigg wrote:
I'm not sure what you guys mean by 'cookies' exactly, but I agree

Well, if the number had some encoded meaning to the plugin, beyond simple indexing, it would be a cookie. For example, let's assume that all parameter pathanems become an unsigned 32 bit integer ID.

Some plugins would assign those as a simple index (0, 1, 2, ... n,).
Trixier plugins might say the low order byte is the index, the 2nd byte is
the sub-group, and the upper two bytes are unused.  So instead of seeing
(0, 1, 2, ...) you might see (0, 1, 256, 257, 512, 513 etc).
(makes more sense as hex: 0x0000, 0x0001, 0x0100, 0x0101, 0x0200, 0x0201)

The key is that the host doesn't know anything about that unsigned 32 bit
int except that it is guaranteed unique within the plugin.  The plugin can
use the cookie as a shortcut on parameter lookups, if it likes.  Heck, it
could even encode internal pointer values into the ID.

Just an idea (from XAP :)

I see. That's clever, it's encoding an address in bitfields of the ID. We do have a map that expresses the OSC-style-path addresses already, and all paths should be expressible there, so it's partially redundant to that (meaning the two encodings would need to stay synced), but I can see how it could simplify code, and should work. It's just a number assignment technique, and all those numbers are up to the plug author anyway event, so sure, go nuts.


-- Chris G.

----------------------------------------------------------------------
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: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: