mmontag / chip-player-js

Web-based music player for a variety of video game and chiptune music formats.
https://chiptune.app
GNU General Public License v3.0
324 stars 17 forks source link

extremely high windows sample rates confuse some of the players. #150

Closed zaphod77 closed 1 month ago

zaphod77 commented 3 months ago

specifically anything higher than 96Khz breaks a lot of them. libadlmidi copes beautifully with it, but libfluidsynthlite chokes, and writes 96k samples anyway, resulting in wrong octaves.

My new computer can and does do 192khz 24 bit. it horribly breaks the vgm player as well.

mmontag commented 3 months ago

Thank you for pinpointing the issue here. Just when I thought I had fixed the sample rate issues, a new edge case appears...

In order to fix this, I might try to cap the AudioContext at 96 kHz. I don't imagine FluidSynth would benefit much from high sample rates because Soundfonts are authored at 44.1 kHz. The synth will just be doing a whole lot of interpolation.[^1]

[^1]: In my opinion, super high sample rates are mostly beneficial to the production process. It would be useful to record a tambourine sample at 192 kHz if you intend to pitch it down 3 octaves, because you'll retain high frequency information.

zaphod77 commented 3 months ago

a higher sample rate might affect the sound of chorus some, at least in theory, but anyway i'm glad to find the case for you.