forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
CircuitPython version and board name
Adafruit CircuitPython 9.2.6 on 2025-03-23; Raspberry Pi Pico 2 with rp2350aCode/REPL
import time, board, audiobusio, synthio, audiofilters
audio = audiobusio.I2SOut(bit_clock=board.GP20, word_select=board.GP21, data=board.GP22)
synth = synthio.Synthesizer(channel_count=1, sample_rate=44100)
effect = audiofilters.Filter(buffer_size=1024, channel_count=1, sample_rate=44100, mix=1.0)
effect.filter = synth.low_pass_filter(frequency=2000, Q=1.25)
effect.play(synth)
audio.play(effect)
note = synthio.Note(261)
while True:
synth.press(note)
time.sleep(0.25)
synth.release(note)
time.sleep(5)Behavior
Traceback (most recent call last):
File "code.py", line 10, in <module>
TypeError: object in filter must be of type AnyBiquad, not float
Description
The above code is from the demo code in documentation for audiofillters.Filter https://docs.circuitpython.org/en/latest/shared-bindings/audiofilters/index.html#audiofilters.Filter
It fails with the same error if you try to use the newer BlockBiquad, e.g.:
effect.filter = synthio.BlockBiquad(synthio.FilterMode.LOW_PASS, frequency=2000, Q=1.25)Additional information
No response