diff options
Diffstat (limited to 'modules/diag~.c')
-rw-r--r-- | modules/diag~.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/diag~.c b/modules/diag~.c index c8a94c5..1e99682 100644 --- a/modules/diag~.c +++ b/modules/diag~.c @@ -43,8 +43,8 @@ typedef struct diag } t_diag; -static float randfloat(void){ - float r = rand (); +static t_float randfloat(void){ + t_float r = rand (); r /= (RAND_MAX/2); r -= 1; return r; @@ -62,15 +62,15 @@ static void diag_eigen(t_diag *x, t_floatarg index, t_floatarg val) /* set decay time of pole at index */ static void diag_time(t_diag *x, t_floatarg index, t_floatarg time) { - float r; + t_float r; /* time in ms */ time *= 0.001; - if (time < 0.0f) time = 0.0f; - r = pow(0.001f, (t_float)x->x_ctl.c_order / (time * sys_getsr())); - if (r < 0.0f) r = 0.0f; - if (r > 1.0f) r = 1.0f; + if (time < 0.0) time = 0.0; + r = pow(0.001, (t_float)x->x_ctl.c_order / (time * sys_getsr())); + if (r < 0.0) r = 0.0; + if (r > 1.0) r = 1.0; diag_eigen(x, index, r); } |