Skip to content

Commit c3ce141

Browse files
committed
Prevent automatic updating of filter property when constructing synthio.Biquad object.
1 parent 375b255 commit c3ce141

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

shared-bindings/audiofilters/Filter.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ static mp_obj_t audiofilters_filter_obj_lpf(size_t n_args, const mp_obj_t *pos_a
188188

189189
mp_float_t w0 = f0 / self->sample_rate * 2 * MP_PI;
190190

191-
mp_obj_t biquad = common_hal_synthio_new_lpf(w0, Q);
192-
common_hal_audiofilters_filter_set_filter(self, biquad);
193-
return biquad;
191+
return common_hal_synthio_new_lpf(w0, Q);
194192
}
195193

196194
MP_DEFINE_CONST_FUN_OBJ_KW(audiofilters_filter_lpf_obj, 1, audiofilters_filter_obj_lpf);
@@ -220,9 +218,7 @@ static mp_obj_t audiofilters_filter_obj_hpf(size_t n_args, const mp_obj_t *pos_a
220218

221219
mp_float_t w0 = f0 / self->sample_rate * 2 * MP_PI;
222220

223-
mp_obj_t biquad = common_hal_synthio_new_hpf(w0, Q);
224-
common_hal_audiofilters_filter_set_filter(self, biquad);
225-
return biquad;
221+
return common_hal_synthio_new_hpf(w0, Q);
226222
}
227223

228224
MP_DEFINE_CONST_FUN_OBJ_KW(audiofilters_filter_hpf_obj, 1, audiofilters_filter_obj_hpf);
@@ -254,9 +250,7 @@ static mp_obj_t audiofilters_filter_obj_bpf(size_t n_args, const mp_obj_t *pos_a
254250

255251
mp_float_t w0 = f0 / self->sample_rate * 2 * MP_PI;
256252

257-
mp_obj_t biquad = common_hal_synthio_new_bpf(w0, Q);
258-
common_hal_audiofilters_filter_set_filter(self, biquad);
259-
return biquad;
253+
return common_hal_synthio_new_bpf(w0, Q);
260254
}
261255

262256
MP_DEFINE_CONST_FUN_OBJ_KW(audiofilters_filter_bpf_obj, 1, audiofilters_filter_obj_bpf);

0 commit comments

Comments
 (0)