schellingb / TinySoundFont

SoundFont2 synthesizer library in a single C/C++ file
MIT License
608 stars 71 forks source link

Reading samples directly at runtime (port to STM32) #74

Open Tronix286 opened 1 year ago

Tronix286 commented 1 year ago

Given: STM32 micro with ~384Kb-512Kb RAM; SD card connected to STM32 with fast SDIO 6-wire interface running at 24MHz clock; FatFS, so files at SD-card can operate fopen() fclose() fseek() etc...

In your opinion, is it possible to read SF2 samples not into the main memory, but directly in pieces of the required size from a file (stream) at the runtime of sound rendering? Or into a small buffer? Is it difficult to implement? Thanks in advance.

yishengjiang99 commented 1 year ago

I don’t think you want to do any file io ops in real time.. see #4 in this article https://atastypixel.com/four-common-mistakes-in-audio-development/