Re: [LAD] Plugin buffer size restrictions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff McClintock <jef@...>
Cc: <linux-audio-dev@...>
Date: Wednesday, May 30, 2012 - 4:25 am

On Wed, 2012-05-30 at 15:03 +1200, Jeff McClintock wrote:

I'm a modular head, I remain convinced that control ports are nothing
but a pain in the ass and CV for everything would be a wonderful fantasy
land :)

As it happens, I am currently porting the blop plugins to LV2, and
making a new extension in order to drop the many plugin variants (which
are a nightmare from the user POV). This simple extension lets you
switch a port from its default type (e.g. Control) to another type (e.g.
CV). The pattern looks something like this:

/* plugin->frequency_is_cv is 1 if a CV buffer, 0 if a single float */
for (uint32_t i = 0; i < sample_count; ++i) {
const float freq = frequency[s * plugin->frequency_is_cv];
if (freq != plugin->last_frequency) {
plugin->last_frequency = freq;

/* Do stuff */

To get the parameter value, all you pay for the switchability is one
multiplication per sample, which is fine.

Doing those comparisons to see if the value actually changed since the
last sample in order to recalculate is not so great (branching) but it's
not the end of the world either (probably beats recalculating every
sample at least). This is why being told only when the parameter
changes would be better for parameters like this.

The port type switchability means I can move to a fancy new control
ports that work better here without breaking backwards compatibility, so
personally my interest in a solution here is very real. More people
care about normal high level parameters and being able to interpolate
than low-level modular synth CV stuff, but to me it's telling that (it
seems...) one solution can solve both problems nicely.


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, 3:03 am)
Re: [LAD] Plugin buffer size restrictions, David Robillard, (Wed May 30, 4:25 am)