From 33dd6d603830640766aa1a5fe70137c856e2c145 Mon Sep 17 00:00:00 2001 From: musil Date: Thu, 6 Sep 2012 15:54:46 +0000 Subject: other variable names, t_float to t_sample change, array access 64 bit svn path=/trunk/externals/iemlib/; revision=16193 --- iemlib1/src/para_bp2~.c | 170 ++++++++++++++++++++++++------------------------ 1 file changed, 85 insertions(+), 85 deletions(-) (limited to 'iemlib1/src/para_bp2~.c') diff --git a/iemlib1/src/para_bp2~.c b/iemlib1/src/para_bp2~.c index ffeb41d..9ee17e8 100644 --- a/iemlib1/src/para_bp2~.c +++ b/iemlib1/src/para_bp2~.c @@ -51,12 +51,12 @@ static void para_bp2_tilde_calc(t_para_bp2_tilde *x) t_float l, al, gal, l2, rcp; l = x->cur_l; - l2 = l*l + 1.0f; + l2 = l*l + 1.0; al = l*x->cur_a; gal = al*x->cur_g; - rcp = 1.0f/(al + l2); + rcp = 1.0/(al + l2); x->a0 = rcp*(l2 + gal); - x->a1 = rcp*2.0f*(2.0f - l2); + x->a1 = rcp*2.0*(2.0 - l2); x->a2 = rcp*(l2 - gal); x->b1 = -x->a1; x->b2 = rcp*(al - l2); @@ -84,10 +84,10 @@ static void para_bp2_tilde_dsp_tick(t_para_bp2_tilde *x) x->cur_f *= x->delta_f; } l = x->cur_f * x->sr; - if(l < 1.0e-20f) - x->cur_l = 1.0e20f; - else if(l > 1.57079632f) - x->cur_l = 0.0f; + if(l < 1.0e-20) + x->cur_l = 1.0e20; + else if(l > 1.57079632) + x->cur_l = 0.0; else { si = sin(l); @@ -128,31 +128,31 @@ static void para_bp2_tilde_dsp_tick(t_para_bp2_tilde *x) /* stability check */ - discriminant = x->b1 * x->b1 + 4.0f * x->b2; - if(x->b1 <= -1.9999996f) - x->b1 = -1.9999996f; - else if(x->b1 >= 1.9999996f) - x->b1 = 1.9999996f; + discriminant = x->b1 * x->b1 + 4.0 * x->b2; + if(x->b1 <= -1.9999996) + x->b1 = -1.9999996; + else if(x->b1 >= 1.9999996) + x->b1 = 1.9999996; - if(x->b2 <= -0.9999998f) - x->b2 = -0.9999998f; - else if(x->b2 >= 0.9999998f) - x->b2 = 0.9999998f; + if(x->b2 <= -0.9999998) + x->b2 = -0.9999998; + else if(x->b2 >= 0.9999998) + x->b2 = 0.9999998; - if(discriminant >= 0.0f) + if(discriminant >= 0.0) { - if(0.9999998f - x->b1 - x->b2 < 0.0f) - x->b2 = 0.9999998f - x->b1; - if(0.9999998f + x->b1 - x->b2 < 0.0f) - x->b2 = 0.9999998f + x->b1; + if(0.9999998 - x->b1 - x->b2 < 0.0) + x->b2 = 0.9999998 - x->b1; + if(0.9999998 + x->b1 - x->b2 < 0.0) + x->b2 = 0.9999998 + x->b1; } } } static t_int *para_bp2_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_para_bp2_tilde *x = (t_para_bp2_tilde *)(w[3]); int i, n = (t_int)(w[4]); t_float wn0, wn1=x->wn1, wn2=x->wn2; @@ -162,16 +162,16 @@ static t_int *para_bp2_tilde_perform(t_int *w) para_bp2_tilde_dsp_tick(x); for(i=0; iwn1 = wn1; x->wn2 = wn2; @@ -190,8 +190,8 @@ y/x = (a0 + a1*z-1 + a2*z-2)/(1 - b1*z-1 - b2*z-2);*/ static t_int *para_bp2_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_para_bp2_tilde *x = (t_para_bp2_tilde *)(w[3]); int i, n = (t_int)(w[4]); t_float wn[10]; @@ -203,22 +203,22 @@ static t_int *para_bp2_tilde_perf8(t_int *w) wn[1] = x->wn1; for(i=0; icur_a) { x->end_a = a; @@ -275,8 +275,8 @@ static void para_bp2_tilde_ft2(t_para_bp2_tilde *x, t_floatarg q) static void para_bp2_tilde_ft1(t_para_bp2_tilde *x, t_floatarg f) { - if(f <= 0.0f) - f = 0.000001f; + if(f <= 0.0) + f = 0.000001; if(f != x->cur_f) { x->end_f = f; @@ -311,18 +311,18 @@ static void para_bp2_tilde_dsp(t_para_bp2_tilde *x, t_signal **sp) t_float si, co, f; int i, n=(int)sp[0]->s_n; - x->sr = 3.14159265358979323846f / (t_float)(sp[0]->s_sr); - x->ticks_per_interpol_time = 0.001f * (t_float)(sp[0]->s_sr) / (t_float)n; + x->sr = 3.14159265358979323846 / (t_float)(sp[0]->s_sr); + 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; f = x->cur_f * x->sr; - if(f < 1.0e-20f) - x->cur_l = 1.0e20f; - else if(f > 1.57079632f) - x->cur_l = 0.0f; + if(f < 1.0e-20) + x->cur_l = 1.0e20; + else if(f > 1.57079632) + x->cur_l = 0.0; else { si = sin(f); @@ -339,7 +339,7 @@ static void *para_bp2_tilde_new(t_symbol *s, int argc, t_atom *argv) { t_para_bp2_tilde *x = (t_para_bp2_tilde *)pd_new(para_bp2_tilde_class); int i; - t_float si, co, f=0.0f, q=1.0f, l=0.0f, interpol=0.0f; + t_float si, co, f=0.0, q=1.0, l=0.0, interpol=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")); @@ -347,7 +347,7 @@ static void *para_bp2_tilde_new(t_symbol *s, int argc, t_atom *argv) inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft4")); outlet_new(&x->x_obj, &s_signal); x->x_debug_outlet = outlet_new(&x->x_obj, &s_list); - x->x_float_sig_in = 0.0f; + x->x_float_sig_in = 0.0; x->x_at[0].a_type = A_FLOAT; x->x_at[1].a_type = A_FLOAT; @@ -359,19 +359,19 @@ static void *para_bp2_tilde_new(t_symbol *s, int argc, t_atom *argv) x->counter_f = 1; x->counter_a = 0; x->counter_g = 0; - x->delta_f = 0.0f; - x->delta_a = 0.0f; - x->delta_g = 0.0f; - x->interpol_time = 500.0f; - x->wn1 = 0.0f; - x->wn2 = 0.0f; - x->a0 = 0.0f; - x->a1 = 0.0f; - x->a2 = 0.0f; - x->b1 = 0.0f; - x->b2 = 0.0f; - x->sr = 3.14159265358979323846f / 44100.0f; - x->cur_a = 1.0f; + x->delta_f = 0.0; + x->delta_a = 0.0; + x->delta_g = 0.0; + x->interpol_time = 500.0; + x->wn1 = 0.0; + x->wn2 = 0.0; + x->a0 = 0.0; + x->a1 = 0.0; + x->a2 = 0.0; + x->b1 = 0.0; + x->b2 = 0.0; + x->sr = 3.14159265358979323846 / 44100.0; + x->cur_a = 1.0; if((argc == 4)&&IS_A_FLOAT(argv,3)&&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,0)) { f = (t_float)atom_getfloatarg(0, argc, argv); @@ -379,33 +379,33 @@ static void *para_bp2_tilde_new(t_symbol *s, int argc, t_atom *argv) l = (t_float)atom_getfloatarg(2, argc, argv); interpol = (t_float)atom_getfloatarg(3, argc, argv); } - if(f <= 0.0f) - f = 0.000001f; + if(f <= 0.0) + f = 0.000001; x->cur_f = f; f *= x->sr; - if(f < 1.0e-20f) - x->cur_l = 1.0e20f; - else if(f > 1.57079632f) - x->cur_l = 0.0f; + if(f < 1.0e-20) + x->cur_l = 1.0e20; + else if(f > 1.57079632) + x->cur_l = 0.0; else { si = sin(f); co = cos(f); x->cur_l = co/si; } - if(q <= 0.0f) - q = 0.000001f; - x->cur_a = 1.0f/q; + if(q <= 0.0) + q = 0.000001; + x->cur_a = 1.0/q; x->cur_g = exp(0.11512925465 * l); - 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_f = x->cur_f; x->end_a = x->cur_a; x->end_g = x->cur_g; -- cgit v1.2.1