aboutsummaryrefslogtreecommitdiff
path: root/iemlib1/src/lp1_t~.c
diff options
context:
space:
mode:
Diffstat (limited to 'iemlib1/src/lp1_t~.c')
-rw-r--r--iemlib1/src/lp1_t~.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/iemlib1/src/lp1_t~.c b/iemlib1/src/lp1_t~.c
index 251cfe7..1444e21 100644
--- a/iemlib1/src/lp1_t~.c
+++ b/iemlib1/src/lp1_t~.c
@@ -54,8 +54,8 @@ static void lp1_t_tilde_dsp_tick(t_lp1_t_tilde *x)
static t_int *lp1_t_tilde_perform(t_int *w)
{
- t_float *in = (t_float *)(w[1]);
- t_float *out = (t_float *)(w[2]);
+ t_sample *in = (t_sample *)(w[1]);
+ t_sample *out = (t_sample *)(w[2]);
t_lp1_t_tilde *x = (t_lp1_t_tilde *)(w[3]);
int i, n = (t_int)(w[4]);
double yn0, yn1=x->yn1;
@@ -65,7 +65,7 @@ static t_int *lp1_t_tilde_perform(t_int *w)
for(i=0; i<n; i++)
{
yn0 = (double)(*in++)*c0 + yn1*c1;
- *out++ = (t_float)yn0;
+ *out++ = (t_sample)yn0;
yn1 = yn0;
}
/* NAN protect */
@@ -77,8 +77,8 @@ static t_int *lp1_t_tilde_perform(t_int *w)
static t_int *lp1_t_tilde_perf8(t_int *w)
{
- t_float *in = (t_float *)(w[1]);
- t_float *out = (t_float *)(w[2]);
+ t_sample *in = (t_sample *)(w[1]);
+ t_sample *out = (t_sample *)(w[2]);
t_lp1_t_tilde *x = (t_lp1_t_tilde *)(w[3]);
int i, n = (t_int)(w[4]);
double ynn[9];
@@ -89,21 +89,21 @@ static t_int *lp1_t_tilde_perf8(t_int *w)
for(i=0; i<n; i+=8, in+=8, out+=8)
{
ynn[1] = (double)in[0]*c0 + ynn[0]*c1;
- out[0] = (t_float)ynn[1];
+ out[0] = (t_sample)ynn[1];
ynn[2] = (double)in[1]*c0 + ynn[1]*c1;
- out[1] = (t_float)ynn[2];
+ out[1] = (t_sample)ynn[2];
ynn[3] = (double)in[2]*c0 + ynn[2]*c1;
- out[2] = (t_float)ynn[3];
+ out[2] = (t_sample)ynn[3];
ynn[4] = (double)in[3]*c0 + ynn[3]*c1;
- out[3] = (t_float)ynn[4];
+ out[3] = (t_sample)ynn[4];
ynn[5] = (double)in[4]*c0 + ynn[4]*c1;
- out[4] = (t_float)ynn[5];
+ out[4] = (t_sample)ynn[5];
ynn[6] = (double)in[5]*c0 + ynn[5]*c1;
- out[5] = (t_float)ynn[6];
+ out[5] = (t_sample)ynn[6];
ynn[7] = (double)in[6]*c0 + ynn[6]*c1;
- out[6] = (t_float)ynn[7];
+ out[6] = (t_sample)ynn[7];
ynn[8] = (double)in[7]*c0 + ynn[7]*c1;
- out[7] = (t_float)ynn[8];
+ out[7] = (t_sample)ynn[8];
ynn[0] = ynn[8];
}
/* NAN protect */
@@ -122,15 +122,15 @@ static void lp1_t_tilde_ft2(t_lp1_t_tilde *x, t_floatarg interpol)
if(i <= 0)
i = 1;
x->ticks = i;
- x->rcp_ticks = 1.0f / (t_float)i;
+ x->rcp_ticks = 1.0 / (t_float)i;
}
static void lp1_t_tilde_ft1(t_lp1_t_tilde *x, t_floatarg f_time_const)
{
double d_time_const;
- if(f_time_const < 0.0f)
- f_time_const = 0.0f;
+ if(f_time_const < 0.0)
+ f_time_const = 0.0;
d_time_const = (double)f_time_const;
if(d_time_const != x->cur_t)
{
@@ -150,12 +150,12 @@ static void lp1_t_tilde_dsp(t_lp1_t_tilde *x, t_signal **sp)
int i, n=(int)sp[0]->s_n;
x->sr = -1000.0 / (double)(sp[0]->s_sr);
- x->ticks_per_interpol_time = 0.001f * (t_float)(sp[0]->s_sr) / (t_float)n;
+ x->ticks_per_interpol_time = 0.001 * (t_float)(sp[0]->s_sr) / (t_float)n;
i = (int)((x->ticks_per_interpol_time)*(x->interpol_time));
if(i <= 0)
i = 1;
x->ticks = i;
- x->rcp_ticks = 1.0f / (t_float)i;
+ x->rcp_ticks = 1.0 / (t_float)i;
if(x->cur_t == 0.0)
x->c1 = 0.0;
else
@@ -171,16 +171,16 @@ static void *lp1_t_tilde_new(t_symbol *s, int argc, t_atom *argv)
{
t_lp1_t_tilde *x = (t_lp1_t_tilde *)pd_new(lp1_t_tilde_class);
int i;
- t_float interpol=0.0f;
+ t_float interpol=0.0;
double time_const=0.0;
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_float_sig_in = 0.0f;
+ x->x_float_sig_in = 0.0;
x->counter_t = 1;
x->delta_t = 0.0;
- x->interpol_time = 0.0f;
+ x->interpol_time = 0.0;
x->yn1 = 0.0;
x->sr = -1.0 / 44.1;
if((argc >= 1)&&IS_A_FLOAT(argv,0))
@@ -195,15 +195,15 @@ static void *lp1_t_tilde_new(t_symbol *s, int argc, t_atom *argv)
else
x->c1 = exp((x->sr)/time_const);
x->c0 = 1.0 - x->c1;
- if(interpol < 0.0f)
- interpol = 0.0f;
+ if(interpol < 0.0)
+ interpol = 0.0;
x->interpol_time = interpol;
- x->ticks_per_interpol_time = 0.5f;
+ x->ticks_per_interpol_time = 0.5;
i = (int)((x->ticks_per_interpol_time)*(x->interpol_time));
if(i <= 0)
i = 1;
x->ticks = i;
- x->rcp_ticks = 1.0f / (t_float)i;
+ x->rcp_ticks = 1.0 / (t_float)i;
x->end_t = x->cur_t;
return (x);
}