diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2010-02-10 00:34:05 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2010-02-10 00:34:05 +0000 |
commit | 086e6b358ad45bda0e6a948cfb7ea2d33ab7da5a (patch) | |
tree | b87b0adfbfd8f9b9439d8bf528b63b64f23dce03 /source/lavg.c | |
parent | 98e3e1214cf71a62b2de938c9c7e07f6bdd0090c (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/lavg.c')
-rw-r--r-- | source/lavg.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/source/lavg.c b/source/lavg.c deleted file mode 100644 index fce0015..0000000 --- a/source/lavg.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "defines.h"
-
-/*--------------- lavg ---------------*/
-
-static t_class *lavg_class;
-
-typedef struct _lavg
-{
- t_object x_obj;
- float m_avg;
- float m_c_leak;
- float m_leak;
-} t_lavg;
-
-
-static void lavg_perform(t_lavg *x, t_float in)
-{
- x->m_avg= x->m_avg * x->m_c_leak + in * x->m_leak;
- outlet_float(x->x_obj.ob_outlet, x->m_avg);
-}
-
-static void lavg_clear(t_lavg *x)
-{
- x->m_avg=0.0f;
-}
-
-static void lavg_setHalfDecay(t_lavg *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 *lavg_new( t_float halfDecayTime)
-{
- t_lavg *x=(t_lavg *)pd_new(lavg_class);
- outlet_new(&x->x_obj, gensym("float"));
-
- lavg_setHalfDecay(x, halfDecayTime);
- return (void *)x;
-}
-
-void lavg_setup(void)
-{
- lavg_class = class_new(gensym("lavg"),
- (t_newmethod)lavg_new, 0,
- sizeof(t_lavg),
- CLASS_DEFAULT,
- A_DEFFLOAT, 0);
- class_addfloat(lavg_class, (t_method)lavg_perform);
- class_addmethod(lavg_class, (t_method)lavg_setHalfDecay,
- gensym("decay"), A_DEFFLOAT, NULL);
- class_addmethod(lavg_class, (t_method)lavg_clear,
- gensym("clear"), 0);
-}
-
|