13
0

Fix code to prepare re-enable cubic spline interpolation of automation data.

see also 24917e4c9e
This commit is contained in:
Robin Gareus 2014-05-30 04:25:59 +02:00
parent e69057319e
commit 5aecc877d6

View File

@ -402,16 +402,17 @@ Curve::multipoint_eval (double x)
double tdelta = x - before->when;
double trange = after->when - before->when;
#if 1 // Linear Interpolation
return before->value + (vdelta * (tdelta / trange));
#if 0
double x2 = x * x;
ControlEvent* ev = *range.second;
return = ev->coeff[0] + (ev->coeff[1] * x) + (ev->coeff[2] * x2) + (ev->coeff[3] * x2 * x);
#else // cubic spline
if (!after->coeff) {
return before->value + (vdelta * (tdelta / trange));
} else {
ControlEvent* ev = after;
double x2 = x * x;
return ev->coeff[0] + (ev->coeff[1] * x) + (ev->coeff[2] * x2) + (ev->coeff[3] * x2 * x);
}
#endif
}
/* x is a control point in the data */