Fix code to prepare re-enable cubic spline interpolation of automation data.
see also 24917e4c9e
This commit is contained in:
parent
e69057319e
commit
5aecc877d6
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user