On Sat, Jul 09, 2005 at 03:24:20PM +0300, Artemio wrote:
I am here to ask you one thing. If I want
sample-precise realtime
control for the plugin, should I be getting all the parameters inside
the cycle which travels through the buffer contents?
A control rate parameter does not change during a single call to
your plugin, so it doesn't matter. Reading it again for each sample
is just wasting cpu cycles.
What you can do of course is interpolate it over the length of
the loop. In that case, you use the new value as the one to be
reached at the last sample, and you store this after the loop,
as a starting value for the next call.
Let p represent a paremater value, and N the number of cycles.
p = ... // get parameter value
dp = (p - last_p) / N;
p = last_p;
for (i = 0; i < N; i++)
{
p += dp;
... // use parameter p
}
last_p = p;
Of course, last_p should be part of the instance data.
--
FA