aboutsummaryrefslogtreecommitdiff
path: root/iemlib1/src/lp1_t~.c
diff options
context:
space:
mode:
authormusil <tmusil@users.sourceforge.net>2011-05-06 09:50:16 +0000
committermusil <tmusil@users.sourceforge.net>2011-05-06 09:50:16 +0000
commit4eb1a0d38308a0f8b81f4f71f4579ecb7fb67d2c (patch)
treebfbd8a0eadb4bee2f6492447ea81f3d8131d57b6 /iemlib1/src/lp1_t~.c
parentc3ca7b1bdc3a236590b80c0f2f51fd330e85a6b0 (diff)
changed x_msi to x_float_sig_in, added set message to set internal state of filter
svn path=/trunk/externals/iemlib/; revision=15083
Diffstat (limited to 'iemlib1/src/lp1_t~.c')
-rw-r--r--iemlib1/src/lp1_t~.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/iemlib1/src/lp1_t~.c b/iemlib1/src/lp1_t~.c
index 8005b95..251cfe7 100644
--- a/iemlib1/src/lp1_t~.c
+++ b/iemlib1/src/lp1_t~.c
@@ -1,14 +1,14 @@
/* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iemlib1 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2010 */
+iemlib1 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2011 */
#include "m_pd.h"
#include "iemlib.h"
#include <math.h>
/* -- lp1_t~ - slow dynamic lowpass-filter 1. order controlled by time constant tau input --- */
-/* -- now with double precision -- */
+/* -- now with double precision; for low-frequency filters it is important to calculate the filter in double precision -- */
typedef struct _lp1_t_tilde
{
@@ -25,7 +25,7 @@ typedef struct _lp1_t_tilde
t_float interpol_time;
int ticks;
int counter_t;
- t_float x_msi;
+ t_float x_float_sig_in;
} t_lp1_t_tilde;
static t_class *lp1_t_tilde_class;
@@ -140,6 +140,11 @@ static void lp1_t_tilde_ft1(t_lp1_t_tilde *x, t_floatarg f_time_const)
}
}
+static void lp1_t_tilde_set(t_lp1_t_tilde *x, t_floatarg w1)
+{
+ x->yn1 = (double)w1;
+}
+
static void lp1_t_tilde_dsp(t_lp1_t_tilde *x, t_signal **sp)
{
int i, n=(int)sp[0]->s_n;
@@ -172,7 +177,7 @@ static void *lp1_t_tilde_new(t_symbol *s, int argc, t_atom *argv)
inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft1"));
inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft2"));
outlet_new(&x->x_obj, &s_signal);
- x->x_msi = 0;
+ x->x_float_sig_in = 0.0f;
x->counter_t = 1;
x->delta_t = 0.0;
x->interpol_time = 0.0f;
@@ -207,8 +212,9 @@ void lp1_t_tilde_setup(void)
{
lp1_t_tilde_class = class_new(gensym("lp1_t~"), (t_newmethod)lp1_t_tilde_new,
0, sizeof(t_lp1_t_tilde), 0, A_GIMME, 0);
- CLASS_MAINSIGNALIN(lp1_t_tilde_class, t_lp1_t_tilde, x_msi);
+ CLASS_MAINSIGNALIN(lp1_t_tilde_class, t_lp1_t_tilde, x_float_sig_in);
class_addmethod(lp1_t_tilde_class, (t_method)lp1_t_tilde_dsp, gensym("dsp"), 0);
class_addmethod(lp1_t_tilde_class, (t_method)lp1_t_tilde_ft1, gensym("ft1"), A_FLOAT, 0);
class_addmethod(lp1_t_tilde_class, (t_method)lp1_t_tilde_ft2, gensym("ft2"), A_FLOAT, 0);
+ class_addmethod(lp1_t_tilde_class, (t_method)lp1_t_tilde_set, gensym("set"), A_FLOAT, 0);
}