You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""filter Q over 1.41 causes glitches in the filter at certain frequency"""importtime, board, synthio, audiobusio, audiomixerSAMPLE_RATE=44100BUFFER_SIZE=2048i2s_bck_pin=board.GP20i2s_lck_pin=board.GP21i2s_dat_pin=board.GP22audio=audiobusio.I2SOut(bit_clock=i2s_bck_pin, word_select=i2s_lck_pin, data=i2s_dat_pin)
mixer=audiomixer.Mixer(sample_rate=SAMPLE_RATE, channel_count=2, buffer_size=BUFFER_SIZE)
synth=synthio.Synthesizer(sample_rate=SAMPLE_RATE, channel_count=2)
audio.play(mixer)
mixer.voice[0].play(synth)
midi_notes= [ 49, # glitch near 170 & 150 Hz37, # glitch near 100, 70, & 60 Hz36, # gitch near 70 & 60 Hz42, # glitch near 100 Hz47, # glitch near 120 Hz
]
whileTrue:
forninmidi_notes:
midi_note_f=synthio.midi_to_hz(n)
note=synthio.Note(midi_note_f)
note.filter=synthio.BlockBiquad(synthio.FilterMode.LOW_PASS,
frequency=200, Q=1.5)
synth.press(note)
forfinrange(21): # modulate the filter down by hand to find glitchesfilter_freq=200- (10*f)
print("Q: %.2f filter freq: %3d note freq: %3.2f"%
(note.filter.Q, filter_freq, midi_note_f))
note.filter.frequency=filter_freqtime.sleep(0.3)
synth.release(note)
Behavior
When synthio.BlockBiquad is set to certain frequencies with Q>1.41, strange oscillations / "glitches" occur that should not. In general it seems to be around the pitch of the playing note and lower.
Description
Here's a video showing the above code running on a Pico2 RP2350 driving an I2S DAC.
The behavior is the same on a Pico RP2040 with I2S DAC. The behavior is also the same with PWMOut.
This behavior has existed since synthio has had filters, but with BlockBiquad it's more noticeable because we can easily modulate the filter frequency.
synthio_filter_glitch.mp4
Additional information
No response
The text was updated successfully, but these errors were encountered:
CircuitPython version and board name
Code/REPL
Behavior
When
synthio.BlockBiquad
is set to certain frequencies with Q>1.41, strange oscillations / "glitches" occur that should not. In general it seems to be around the pitch of the playing note and lower.Description
Here's a video showing the above code running on a Pico2 RP2350 driving an I2S DAC.
The behavior is the same on a Pico RP2040 with I2S DAC. The behavior is also the same with
PWMOut
.This behavior has existed since
synthio
has had filters, but withBlockBiquad
it's more noticeable because we can easily modulate the filter frequency.synthio_filter_glitch.mp4
Additional information
No response
The text was updated successfully, but these errors were encountered: