[LAD] Plugin buffer size restrictions
fons at linuxaudio.org
Mon May 28 19:48:45 UTC 2012
On Mon, May 28, 2012 at 01:30:37PM -0400, David Robillard wrote:
> > Take a filter plugin. Calculating the actual filter coefficients
> > from the 'user' parameters (frequency, gain, etc..) can easily be
> > 10..1000 times more complex than actually using those coefficients
> > to process one sample. So you really don't want to do that at the
> > audio sample rate. A normal EQ as used in a DAW could do this once
> > every 10 ms or so and use simple linear interpolation in between.
> > And even that doesn't mean the filter should accept arbitrary
> > 'user' parameters on each such update - these have to be rate
> > limited first as well.
> This is also an argument for not using signals for controls at all.
Assuming that by 'signals' you mean audio rate controls, yes.
Again, the exception is 'synthesis' modules. You'd expect a
VCA in a modular synth to do what the ADSR tells it to do,
even if that results in artefacts. But you wouldn't want a
fader in a DAW (essentially the same thing if implemented as
a plugin) to do the same.
> It's better in many cases to be explicitly told when the control value
Yes, but if that 'when' is not a regular period, and assuming you
want to actually reach the value, there's little you can do excecpt
linearly interpolate from the previous value. This makes the control
value continuous, but not its derivative(s). And that can be more
than enought to generate clicks, zipper noise, etc. Not only you
don't know what the next value will be, you don't even know when
it will arrive. It could be one millisecond later or one minute.
So the only thing you can do to have click and zipper-free output
is to apply enough filtering to guarantee this, whatever the input.
Which means ignoring most of the 'detail' in the input. Which in
turn means it's futile to provide such input in the first place.
A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)
More information about the Linux-audio-dev