From 494a07a361fe4ee0e54f77468a976b1a77818770 Mon Sep 17 00:00:00 2001 From: Tom Schouten Date: Fri, 12 Sep 2003 22:26:57 +0000 Subject: creb 0.9.0 svn path=/trunk/externals/creb/; revision=956 --- modules/ear.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/ear.c') diff --git a/modules/ear.c b/modules/ear.c index d842065..28fe097 100644 --- a/modules/ear.c +++ b/modules/ear.c @@ -47,6 +47,7 @@ void ear_release(t_ear *x, t_floatarg f) void ear_start(t_ear *x) { x->x_ctl.c_target = 1; + x->x_ctl.c_state = 0.0f; } @@ -56,6 +57,12 @@ void ear_stop(t_ear *x) } +void ear_float(t_ear *x, t_floatarg f) +{ + if (f == 0.0f) ear_stop(x); + else ear_start(x); +} + static t_int *ear_perform(t_int *w) { t_float *out = (float *)(w[3]); @@ -120,6 +127,7 @@ void ear_tilde_setup(void) //post("ear~ v0.1"); ear_class = class_new(gensym("ear~"), (t_newmethod)ear_new, (t_method)ear_free, sizeof(t_ear), 0, A_DEFFLOAT, A_DEFFLOAT, 0); + class_addmethod(ear_class, (t_method)ear_float, gensym("float"), A_FLOAT, 0); class_addmethod(ear_class, (t_method)ear_start, gensym("start"), 0); class_addmethod(ear_class, (t_method)ear_start, gensym("bang"), 0); class_addmethod(ear_class, (t_method)ear_stop, gensym("stop"), 0); -- cgit v1.2.1