aboutsummaryrefslogtreecommitdiff
path: root/tab/tabread4c~.c
diff options
context:
space:
mode:
Diffstat (limited to 'tab/tabread4c~.c')
-rw-r--r--tab/tabread4c~.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tab/tabread4c~.c b/tab/tabread4c~.c
index 41f4ff3..c4a7804 100644
--- a/tab/tabread4c~.c
+++ b/tab/tabread4c~.c
@@ -72,7 +72,7 @@ static t_int *tabread4c_tilde_perform(t_int *w)
int maxindex;
t_word *buf = x->x_vec, *wp;
int i;
- double a0,a1,a2; // CH
+ double a3,a1,a2; // CH
maxindex = x->x_npoints - 3;
@@ -117,10 +117,12 @@ static t_int *tabread4c_tilde_perform(t_int *w)
// cminusb - 0.1666667f * (1.-frac) * (
// (d - a - 3.0f * cminusb) * frac + (d + 2.0f*a - 3.0f*b)
// CH
- a0 = d - c - a + b;
- a1 = a - b - a0;
- a2 = c - a;
- *out++ = ((a0*frac+a1)*frac+a2)*frac+b;
+ // 4-point, 3rd-order Hermite (x-form)
+ a1 = 0.5f * (c - a);
+ a2 = a - 2.5 * b + 2.f * c - 0.5f * d;
+ a3 = 0.5f * (d - a) + 1.5f * (b - c);
+
+ *out++ = ((a3 * frac + a2) * frac + a1) * frac + b;
}
return (w+5);
zero: