aboutsummaryrefslogtreecommitdiff
path: root/vlrange.c
diff options
context:
space:
mode:
Diffstat (limited to 'vlrange.c')
-rw-r--r--vlrange.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/vlrange.c b/vlrange.c
index 07b383f..81f32ff 100644
--- a/vlrange.c
+++ b/vlrange.c
@@ -9,10 +9,10 @@ static t_class *vlrange_class;
typedef struct _vlrange
{
t_object x_obj;
- float m_c_leak;
- float m_leak;
- float *m_min;
- float *m_max;
+ t_float m_c_leak;
+ t_float m_leak;
+ t_float *m_min;
+ t_float *m_max;
int m_n;
} t_vlrange;
@@ -21,9 +21,9 @@ static void vlrange_perform(t_vlrange *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
t_atom *ap,*app;
- float *fmin, *fmax;
- float m_leak;
- float m_c_leak;
+ t_float *fmin, *fmax;
+ t_float m_leak;
+ t_float m_c_leak;
m_leak=x->m_leak;
m_c_leak=x->m_c_leak;
@@ -35,12 +35,12 @@ static void vlrange_perform(t_vlrange *x, t_symbol *s, int argc, t_atom *argv)
freebytes(x->m_min,x->m_n);
freebytes(x->m_max,x->m_n);
}
- x->m_min=(float*)getbytes(argc*sizeof(float));
- x->m_max=(float*)getbytes(argc*sizeof(float));
+ x->m_min=(t_float*)getbytes(argc*sizeof(t_float));
+ x->m_max=(t_float*)getbytes(argc*sizeof(t_float));
for(i=0;i<argc;i++)
{
- x->m_min[i]=0.0f;
- x->m_max[i]=0.0f;
+ x->m_min[i]=0.0;
+ x->m_max[i]=0.0;
}
x->m_n=argc;
}
@@ -51,7 +51,7 @@ static void vlrange_perform(t_vlrange *x, t_symbol *s, int argc, t_atom *argv)
app=ap;
for (i = 0; i < argc; i++)
{
- float f=atom_getfloat(argv++);
+ t_float f=atom_getfloat(argv++);
*fmax =(f > *fmax ) ? f : *fmax *m_c_leak + f*m_leak;
*fmin =(f < *fmin ) ? f : *fmin *m_c_leak + f*m_leak;
SETFLOAT(app, *fmax-*fmin);
@@ -65,7 +65,7 @@ static void vlrange_perform(t_vlrange *x, t_symbol *s, int argc, t_atom *argv)
static void vlrange_setHalfDecay(t_vlrange *x, t_floatarg halfDecayTime)
{
- x->m_c_leak=(float)powf(.5,(1.0f/halfDecayTime));
+ x->m_c_leak=(t_float)powf(.5,(1.0/halfDecayTime));
x->m_leak=1.0f-x->m_c_leak;
}