aboutsummaryrefslogtreecommitdiff
path: root/source/lmin.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-02-10 00:34:05 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-02-10 00:34:05 +0000
commit086e6b358ad45bda0e6a948cfb7ea2d33ab7da5a (patch)
treeb87b0adfbfd8f9b9439d8bf528b63b64f23dce03 /source/lmin.c
parent98e3e1214cf71a62b2de938c9c7e07f6bdd0090c (diff)
re-arranged into libdir and setup with the template Makefile+debian stuff. renabled vv+ and vv- as vvplus and vvminus
svn path=/trunk/externals/smlib/; revision=13158
Diffstat (limited to 'source/lmin.c')
-rw-r--r--source/lmin.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/source/lmin.c b/source/lmin.c
deleted file mode 100644
index 51b333a..0000000
--- a/source/lmin.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "defines.h"
-
-/*--------------- lmin ---------------*/
-
-static t_class *lmin_class;
-
-typedef struct _lmin
-{
- t_object x_obj;
- float m_min;
- float m_leak;
- float m_c_leak;
-} t_lmin;
-
-
-static void lmin_perform(t_lmin *x, t_float in)
-{
- x->m_min=(in < x->m_min) ? in : x->m_min * x->m_c_leak + in * x->m_leak;
- outlet_float(x->x_obj.ob_outlet, x->m_min);
-}
-
-static void lmin_setHalfDecay(t_lmin *x, t_float halfDecayTime)
-{
- x->m_c_leak=(float)powf(.5,(1.0f/halfDecayTime));
- x->m_leak=1.0f-x->m_c_leak;
-}
-
-static void lmin_clear(t_lmin *x)
-{
- x->m_min= MAXFLOAT;
-}
-
-static void *lmin_new( t_float halfDecayTime)
-{
- t_lmin *x=(t_lmin *)pd_new(lmin_class);
- outlet_new(&x->x_obj, gensym("float"));
-
- lmin_setHalfDecay(x, halfDecayTime);
- lmin_clear(x);
- return (void *)x;
-}
-
-
-void lmin_setup(void)
-{
- lmin_class = class_new(gensym("lmin"),
- (t_newmethod)lmin_new, 0,
- sizeof(t_lmin),
- CLASS_DEFAULT,
- A_DEFFLOAT, 0);
- class_addfloat(lmin_class, (t_method)lmin_perform);
- class_addmethod(lmin_class, (t_method)lmin_clear,
- gensym("clear"), A_GIMME, NULL);
- class_addmethod(lmin_class, (t_method)lmin_setHalfDecay,
- gensym("decay"), A_DEFFLOAT, NULL);
-}
-