Skip to content

Commit 6054810

Browse files
committed
Fix filters again
1 parent d60a780 commit 6054810

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

shared-bindings/audiofilters/Filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
static mp_obj_t audiofilters_filter_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
7474
enum { ARG_filter, ARG_mix, ARG_buffer_size, ARG_sample_rate, ARG_bits_per_sample, ARG_samples_signed, ARG_channel_count, };
7575
static const mp_arg_t allowed_args[] = {
76-
{ MP_QSTR_filter, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} },
76+
{ MP_QSTR_filter, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_ROM_NONE } },
7777
{ MP_QSTR_mix, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_ROM_INT(1)} },
7878
{ MP_QSTR_buffer_size, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 512} },
7979
{ MP_QSTR_sample_rate, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 8000} },

shared-module/audiofilters/Filter.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ audioio_get_buffer_result_t audiofilters_filter_get_buffer(audiofilters_filter_o
185185
channel = 0;
186186
}
187187

188-
// get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required
189-
mp_float_t mix = MIN(1.0, MAX(synthio_block_slot_get(&self->mix), 0.0));
190-
191188
// Switch our buffers to the other buffer
192189
self->last_buf_idx = !self->last_buf_idx;
193190

tests/circuitpython/audiofilter_filter_blockbiquads.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from audiofilterhelper import synth_test, white8k
33
from synthio import BlockBiquad, FilterMode
44

5+
56
@synth_test
67
def basic_filter():
78
effect = Filter(

tests/testlib/audiofilterhelper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
random.seed(41)
99

10-
whitedata = array.array('h', [random.randint(-32000, 32000) for i in range(600)])
10+
whitedata = array.array("h", [random.randint(-32000, 32000) for i in range(600)])
1111
white8k = RawSample(whitedata, sample_rate=8000)
1212

1313
sinedata = array.array("h", [int(32767 * sin(i * 2 * pi / 600)) for i in range(600)])

0 commit comments

Comments
 (0)