First post, by mgiuca
I was getting sick of having to manually start up FluidSynth and connect DOSBox to it (through ALSA, on Linux, for example). So I got around to writing a FluidSynth driver for DOSBox, so it can directly send MIDI commands to FluidSynth via its own API. For those who don't know what this is, it's a MIDI synthesiser that turns DOSBox's MPU-401 MIDI commands into sound.
Its usage is pretty simple, you just set this in the [midi] section:
for example, on Linux, I might have:
Then, all DOSBox MPU-401 games will automatically produce sound without having to start up any extra software. (I don't have many MPU-401 games, but King's Quest VII requires some external MIDI synth, and this works for that game.)
I have found a year-old forum post here with a similar patch, that doesn't appear to have been accepted. So perhaps I am wasting my time, but since I wrote my patch, I may as well post it here. My patch looks simpler than that one -- it doesn't create a whole event structure, it just passes the messages directly to FluidSynth API calls. The whole driver is 137 lines.
I am not sure how hard it is to get MIDI games working in DOSBox under Windows -- perhaps someone can explain what the process is like. But under Linux, it is quite a pain if you don't have a hardware synth, requiring that you set up a separate MIDI synth. Hopefully, this patch will make it much easier to get MIDI games working. Unfortunately, it still requires that the user configure the driver name and specify the path to the soundfont, but at least that can be done on a once-off basis.