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 tdelta = x - before->when;
|
||||||
double trange = after->when - before->when;
|
double trange = after->when - before->when;
|
||||||
|
#if 1 // Linear Interpolation
|
||||||
return before->value + (vdelta * (tdelta / trange));
|
return before->value + (vdelta * (tdelta / trange));
|
||||||
|
#else // cubic spline
|
||||||
#if 0
|
if (!after->coeff) {
|
||||||
|
return before->value + (vdelta * (tdelta / trange));
|
||||||
|
} else {
|
||||||
|
ControlEvent* ev = after;
|
||||||
double x2 = x * x;
|
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);
|
||||||
|
}
|
||||||
return = ev->coeff[0] + (ev->coeff[1] * x) + (ev->coeff[2] * x2) + (ev->coeff[3] * x2 * x);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* x is a control point in the data */
|
/* x is a control point in the data */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user