Closed
Description
CircuitPython version and board name
Adafruit CircuitPython 10.0.0-alpha.2-38-g8a28033587 on 2025-04-25; Pimoroni Pico Plus 2 with rp2350b
Code/REPL
import time
import board
import busio
import audiobusio, audiocore, audiomixer, synthio
import audiofreeverb, audiofilters
CHANNELS = 2
SRATE = 48000
i2s_bclk, i2s_lclk, i2s_data = board.GP2, board.GP3, board.GP4
audio = audiobusio.I2SOut(bit_clock=i2s_bclk, word_select=i2s_lclk, data=i2s_data)
mixer = audiomixer.Mixer(voice_count=1, channel_count=CHANNELS, sample_rate=SRATE, buffer_size=2048)
audio.play(mixer)
synth = synthio.Synthesizer(channel_count=CHANNELS, sample_rate=SRATE)
effect = audiofreeverb.Freeverb(channel_count=CHANNELS, sample_rate=SRATE)
effect.play(synth)
lpf = audiofilters.Filter(channel_count=CHANNELS, sample_rate=SRATE, mix=1.0)
lpf.filter = synthio.Biquad(synthio.FilterMode.LOW_PASS, frequency=1000, Q=1.0)
lpf.play(effect)
mixer.voice[0].play(lpf)
for i in range(24):
print(i + 1)
synth.press(synthio.Note(synthio.midi_to_hz(36 + i * 3), amplitude=0.5))
time.sleep(0.5)
Behavior
Program continues running, but audio ceases altogether when the 10th note is pressed. If the filter and its module is removed, the audio cuts off at the 18th note.
Description
If I add in a print(gc.mem_free())
statement to the for loop, I get 8258240 bytes available at the note that cuts off (the board has 8MB of PSRAM).
Additional information
I initially thought the error was due to internal memory being filled up, but I'm unable to recreate the issue in versions of CircuitPython prior to the latest dev build without audiofreeverb.Freeverb
. I think the error may lie somewhere within that effect.