@@ -100,20 +100,10 @@ void mookVCF_float(t_mookVCF *x, double f){
100
100
101
101
if (in == 1 ){
102
102
x -> s_freq = f < 1. ? 1 : f ;
103
- x -> s_freq = f ;
104
103
object_attr_touch ((t_object * )x , gensym ("cutoff" ));
105
104
mookVCF_calc (x );
106
105
}else if (in == 2 ){
107
- if (f >= 1 ){
108
- f = 1.f - 1E-20 ;
109
- x -> s_res = f ;
110
- }else if (f < 0. ){
111
- f = 0.f ;
112
- x -> s_res = f ;
113
- }else {
114
- x -> s_res = f ;
115
- }
116
-
106
+ x -> s_res = f >= 1.0 ? 1 - 1E-20 : f ;
117
107
object_attr_touch ((t_object * )x , gensym ("resonance" ));
118
108
mookVCF_calc (x );
119
109
}
@@ -130,17 +120,7 @@ t_max_err mookVCF_attr_setcutoff(t_mookVCF *x, void *attr, long argc, t_atom *ar
130
120
t_max_err mookVCF_attr_setresonance (t_mookVCF * x , void * attr , long argc , t_atom * argv ){
131
121
double reso = atom_getfloat (argv );
132
122
133
- if (reso >= 1 ){
134
- reso = 1.f - 1E-20 ;
135
- // reso = 0.98;
136
- x -> s_res = reso ;
137
- }else if (reso < 0. ){
138
- reso = 0.f ;
139
- x -> s_res = reso ;
140
- }else {
141
- x -> s_res = reso ;
142
- }
143
-
123
+ x -> s_res = reso >= 1.0 ? 1 - 1E-20 : reso ;
144
124
mookVCF_calc (x );
145
125
return 0 ;
146
126
}
@@ -150,7 +130,7 @@ void mookVCF_perform64(t_mookVCF *x,t_object *dsp64,double **ins,long numins,dou
150
130
t_double * in1 = ins [0 ];
151
131
t_double * out = outs [0 ];
152
132
t_double freq = x -> s_fcon ? * ins [1 ] : x -> s_freq ; // vérifier s'il y a du signal dans les entrées 2 et 3
153
- t_double res = x -> s_res ? * ins [2 ] : x -> s_res ;
133
+ t_double res = x -> s_rcon ? * ins [2 ] : x -> s_res ;
154
134
155
135
double X ;
156
136
double y1 = x -> s_ym1 ;
@@ -164,10 +144,10 @@ void mookVCF_perform64(t_mookVCF *x,t_object *dsp64,double **ins,long numins,dou
164
144
double t2 = x -> s_t2 ;
165
145
166
146
// scale resonance
167
- if (res >= 1 ){
168
- res = 1.f - 1E-20 ;
169
- }else if (res < 0. ){
170
- res = 0.f ;
147
+ if (res >= 1.0 ){
148
+ res = 1.0 - 1E-20 ;
149
+ }else if (res < 0.0 ){
150
+ res = 0.0 ;
171
151
}
172
152
173
153
// do we need to calculate the coefs ?
@@ -255,6 +235,8 @@ void *mookVCF_new(t_symbol *s, long argc, t_atom *argv){
255
235
if ((argv + 1 )-> a_type == A_FLOAT ){
256
236
object_post ((t_object * )x , "arg[%ld] Resonance: %f" , 1 , atom_getfloat (argv + 1 ));
257
237
}
238
+ }else {
239
+ reso = 0 ;
258
240
}
259
241
}
260
242
0 commit comments