fabiangreffrath / taradino

SDL2 port of Rise of the Triad
GNU General Public License v2.0
35 stars 9 forks source link

Use libADLMIDI for music. #19

Open malespiaut opened 1 year ago

malespiaut commented 1 year ago

If this project want to have OPL3 emulation for music playback, I recommend using libADLMIDI. I've used it in my fork of Rise of the Triad, and integration was not difficult, as I recall it.

https://github.com/Wohlstand/libADLMIDI

fabiangreffrath commented 1 year ago

ALternatively, we could use Nuked OPL3, which is already successfully used in Choco/Crispy/Woof.

fabiangreffrath commented 1 year ago

Not sure if we should strive for OPL emulation, at least in the short/mid term. SDL2_Mixer does pretty well with playing back MIDIs with a soundfont, at least if compared to the SDL_Mixer 1.2 situation.

vanfanel commented 8 months ago

@fabiangreffrath I have just build from taradino latest sources on GNU/Linux, and it doesn't look like it tries to play music via SDL2_Mixer, does it? Is there any music support currently?

fabiangreffrath commented 8 months ago

Just checked on Debian and everything works as expected. Make sure to use the new cmake build system and the taradino executable name.

vanfanel commented 8 months ago

@fabiangreffrath taradino engine works, but without music. Do you get music on Debian? How? There are no notes for the music support.

fabiangreffrath commented 8 months ago

SDL2_Mixer uses fluidsynth for MIDI playback on Linux. So, just make sure to have this package and a suitable soundfont installed.

vanfanel commented 8 months ago

What soundfont do you recommend and where do you have it installed?

fabiangreffrath commented 8 months ago

This depends on the way the fluidsynth package is configured in your distribution. In Debian it's exceptionally easy, because once you have the libfluidsynth package installed it makes sure you have at least one soundfont package installed as well. I always use the TimGM6MB soundfont which is the default solution in Debian and is also bundled as the fallback solution in Woof.

vanfanel commented 8 months ago

@fabiangreffrath Ah, made it work, thanks a lot!

By doing this:

SDL_SOUNDFONTS=/usr/share/soundfonts/FluidR3_GM.sf2 ./taradino

music sounds great with that soundfont!

Had to investigate the SDL_SOUNDFONTS env variable because I do my own SDL2 builds (wayland only, no X11, lightweight dependencies.. my system is a bit... custom).

If only uncapped framerate was available... other than that this port is perfect!