3
/*--------------- hip ---------------*/
23
static void hip_ft1(t_hip *x, t_floatarg f);
25
static void *hip_new(t_floatarg f)
27
t_hip *x = (t_hip *)pd_new(hip_class);
28
inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1"));
29
outlet_new(&x->x_obj, gensym("float"));
30
x->x_ctl = &x->x_cspace;
37
static void hip_ft1(t_hip *x, t_floatarg f)
39
if (f < 0.001) f = 10;
41
x->x_ctl->c_coef = 1 - f * (2 * 3.14159f);
42
if (x->x_ctl->c_coef < 0) x->x_ctl->c_coef = 0;
45
static void hip_perform(t_hip *x, t_float in)
47
t_hipctl *c = x->x_ctl;
49
float coef = c->c_coef;
52
float new = in + coef * last;
57
if (!((last <= 0) || (last >= 0)))
61
outlet_float(x->x_obj.ob_outlet, out);
64
static void hip_clear(t_hip *x, t_floatarg q)
71
hip_class = class_new(gensym("hip"), (t_newmethod)hip_new, 0,
72
sizeof(t_hip), 0, A_DEFFLOAT, 0);
73
class_addfloat(hip_class, (t_method)hip_perform);
74
class_addmethod(hip_class, (t_method)hip_ft1,
75
gensym("ft1"), A_FLOAT, 0);
76
class_addmethod(hip_class, (t_method)hip_clear, gensym("clear"), 0);
b'\\ No newline at end of file'