bef07961ab
I noticed that the loop over 65535 possible denominators took a long time, causing up to 100ms wait for a sound sample to start playing! This algorithm, adapted from an algorithm shown in Python's fractions.py, is guaranteed to find the best denominator in a small number of steps (I think log2-many steps but I'm not sure). In practice, it means the time between samples playing is just 10ms, and some of that is recreating the sine wave sample in Python each time. It often finds the same solution as the old code, but sometimes it finds one a bit better since it compares the ratios using float point instead of integer arithmetic. |
||
---|---|---|
.. | ||
bindings/rp2pio | ||
boards | ||
common-hal | ||
peripherals | ||
sdk@bfcbefafc5 | ||
sdk_config/pico | ||
supervisor | ||
.gitignore | ||
audio_dma.c | ||
audio_dma.h | ||
background.c | ||
background.h | ||
boot_stage2.ld | ||
fatfs_port.c | ||
flash_info.h.jinja | ||
gen_stage2.py | ||
link.ld | ||
Makefile | ||
mpconfigport.h | ||
mpconfigport.mk | ||
mphalport.c | ||
mphalport.h | ||
qstrdefsport.h | ||
README.rst | ||
stage2.c.jinja |
RP2040 ================== This port supports many development boards that utilize RP2040 chips. See https://circuitpython.org/downloads for all supported boards. Building -------- For build instructions see this guide: https://learn.adafruit.com/building-circuitpython/ Port Specific modules --------------------- .. toctree:: ../../shared-bindings/rp2pio/index