libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
396 stars 132 forks source link

Soundfonts not supported by built-in Timidity? #520

Open weirddan455 opened 1 year ago

weirddan455 commented 1 year ago

I couldn't get MIDI sound to work in Chocolate Doom so I started doing some debugging. I built SDL_mixer from source and can't even get a MIDI file to play with the sample playmus program. It's just silence, even though that same file plays just fine with my system's Timidity++ (Arch Linux).

The only uncommented line in my timidity.cfg is soundfont + location. I found this block of code which seems to imply that the soundfont line is completely ignored. Am I reading this right? It seems kind of insane that it's lacking this basic feature and I don't know how you are supposed to get sound without a soundfont.

https://github.com/libsdl-org/SDL_mixer/blob/142b884b67d226137298f56ab7e7e83b5580015d/src/codecs/timidity/timidity.c#L200-L210

sezero commented 1 year ago

The built-in timidity is a fork of an old timidity version, namely 0.2i, therefore it doesn't have soundfont support.

sezero commented 1 year ago

There is an initial patchset for some soundfont support, though. See here: https://github.com/sezero/libtimidity/compare/master...soundfont AFAIR, the missing thing there is the lack of parsing timidity++ style cfg files with both gus patches and soundfonts.