schellingb / TinySoundFont

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

TinySoundFont does not work with sampling frequencies lower than 44100Hz #45

Closed TerminX closed 4 years ago

TerminX commented 4 years ago

This can be verified by changing the output frequency in any of the example programs. 44100Hz and 48000Hz seem to work fine, but 22050Hz, 11025Hz, etc are all broken. I've verified the breakage both with the example programs and with a separate integration of TinySoundFont into an existing project.

schellingb commented 4 years ago

Hi there!

Good catch! It seemed like the lowpass filter coefficients were prone to overflow with lower output sample rates. I didn't mean to close this issue so early but it seems like having "fixes #45" in the commit comment did that automatically. Could you confirm if this is solved on the latest revision?

Thanks for reporting this!

TerminX commented 4 years ago

I can confirm this fixes the issue. Thanks for the quick turnaround time!