schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
732 stars 61 forks source link

Soundfont Implementation/Mapping/Accuracy #71

Open sweatypickle opened 3 years ago

sweatypickle commented 3 years ago

Win 10 64

I'm not exactly sure how soundfonts are being implemented into this core so this may be user error however I haven't been able to get any working properly. Testing with any GM Sierra game and the Doom series produces the same issues where samples seem to be mapping incorrectly. I'll use Leisure Suit Larry 6 as example. In all instances, except when using the SC-88 for obvious reasons, the same soundfont was used. When using any core that supports Fluidsynth/BASSMIDI or a software synth using an external MIDI route (dosbox-pure included) the following was produced.

https://user-images.githubusercontent.com/12215615/104174924-a452e400-53d4-11eb-951a-c3a94421bfb2.mp4

However when using dosbox-pure and the same soundfont, the following music is produced.

https://user-images.githubusercontent.com/12215615/104177090-3e675c00-53d6-11eb-89ad-dc851b7a72ae.mp4

The same issue occurs only in dosbox-pure with any soundfont selected in all GM games I've tested. Any guidance would be appreciated.

schellingb commented 3 years ago

In this core I use my own SF2 synth called TinySoundFont which has some shortcomings when it comes to functionality (no modulators/reverb/chorus) but it doesn't have to deal with the code mess that is FluidSynth or the closed source and platform dependency of BASS. Someone recently proposed a better volume curve calculation which I have yet to include in this core but there is a chance that this would fix this specific problem (notes/channels played with the wrong volume seems to be at least one of the problems). To be honest I was waiting for someone to notice the shortcomings to have a good reason to try to improve my library. Hopefully we can use this as a good test case. Thanks for reporting.

john-parton commented 2 years ago

This is somewhat off-topic, but why isn't there a midi synth built into RetroArch?

DosBOX, ScummVM, prBoom, and I'm sure some of the other cores all handle midi.

Then TinySoundFont and FluidSynth could just be drivers in RetroArch, saving core authors/maintainers the hassle of integrating their own midi synth.