Re: [LAD] Plugin buffer size restrictions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-dev@...>
Date: Wednesday, May 30, 2012 - 6:59 pm

> From: David Robillard

It's called "SynthEdit land" *everything* is CV ;) (not on Linux sorry).

> As it happens, I am currently porting the blop plugins to LV2, and

That's smart. In a simple example this doesn't seem like much of a win.
Because A 1 port plugin has only two possible variants (frequency as
single-float/ buffer). But..
* A 2-port plugin has 4 varients.
* A 3-port plugin has 8 varients.
* A 10 port plugin has 1024 varients!

So you're avoiding that combinatorial nightmare.

I do something similar. The port is flagged as either 'streaming' (use the
entire buffer) or 'static' use a single float. My point of difference is -
the entire buffer is provided either way. So you have the option of writing
the plugin like..

const float freq = frequency[s];


const float freq = frequency[s * plugin->frequency_is_cv];

.. and it works transparently either way. So the extension is backward
compatible with 'dumb' plugins, or 'dumb' plugin standards like VST (I can
interface VST plugins with modular components).

> Doing those comparisons to see if the value actually changed since the

I don't know if you can implement what I do. Once I know which ports are
single floats I 'switch' processing functions. i.e. use a function pointer
to select 1 of several optimised functions. So you write a general purpose
loop like the one above, this is your fallback. Then you write an optimised
one that assumes 'frequency' is a single float - This one has no branching
and no extra multiplication, it's super efficient. You get the best of both
worlds. Note I don't write loops optimised for every possible combination,
just pick a few key ones. The function pointer is one extra level of
indirection, but it's much faster than branching, esp when there's several
ports involved in the decision.

> personally my interest in a solution here is very real. More people


Best Regards,

Linux-audio-dev mailing list

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [LAD] Plugin buffer size restrictions, Jeff McClintock, (Wed May 30, 6:59 pm)
Re: [LAD] Plugin buffer size restrictions, David Robillard, (Wed May 30, 9:09 pm)