[gmpi] Re: on mutliple sample types (OT, but let's finish?)

  • From: "Andrew \"Silver Blade\" Greenwood" <lists@xxxxxxxxxxxxxxxxx>
  • To: <gmpi@xxxxxxxxxxxxx>
  • Date: Mon, 15 Dec 2003 20:43:59 -0000

> > Not sure what performance penalty this would incur (eg, converting one
> > sample format to another), but if it doesn't have much overhead, why not
> > the host specify what format it works with, and let the plugins specify
> > sample type they want...
> It only occurs a penalty when you need to do it.  It has been (accurately)
> pointed out that makng the user worry about this does kinda suck.
> We've been arguing this a lot the last week or so.  Read the archive for
> full history.  I hope to have a decision down today or tomorrow, so we can
> move on!

I have all the emails saved (from this and other mailing lists, a grand
total of over 11,000 messages in under a year!) so I may have a look back
through them at some point.

Here's an idea... Why not have the hosts specify what format they use to
GMPI, and have plugins specify what format they use to GMPI as well. And
then let GMPI do the work, *if* necessary.

So, if a host uses float samples and a plugin uses float samples as well,
when the plugin is going to process, no conversion is necessary. But if a
host uses float and a plugin say a 32-bit integer, somehow the samples could
be converted, either by copying the input float buffer into a different one
temporarily, in 32-bit int format...

I'd probably tackle this with macros maybe:

#define CONVERT_SAMPLE(sample, desired_type) \

You'd pass the sample parameter as inputbuffer[x] for example. You'd
probably need to typecast the input buffer somehow to the same type the host
uses (maybe this could be specified to the plugin?)

But like you said, this does make the user have to worry about it.

Maybe the host could be responsible for the conversion?

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: