Opened 19 years ago

Closed 19 years ago

Last modified 5 years ago

#8413 closed patch

FluidSynth MIDI driver

Reported by: eriktorbjorn Owned by: eriktorbjorn
Priority: normal Component: Audio
Version: Keywords:
Cc: Game:


I don't know if this is of any use to anyone, but it seemed like a fun thing to do. It's a MIDI driver that uses libfluidsynth to generate the sound. It's still a bit rough around the edges, and there are a few caveats:

* It needs a soundfont. I use the "soundfont" config setting (like the Core Audio driver does), but there is currently no GUI for it.

* Some music is played at the wrong pitch. This does not happen if you hook up the standalone FlulidSynth player via ALSA, so it must be something I'm doing wrong.

* For some reason it won't work in SCUMM games if "multi midi" mode is enabled. It seems the "timer" function isn't called in the driver, or something like that.

* It has not been tested on any big-endian system.

Ticket imported from: #1175374. Ticket imported from: patches/518.

Attachments (2)

fluidsynth3.diff (10.5 KB ) - added by eriktorbjorn 19 years ago.
Patch against an April 7 CVS snapshot
fluidsynth4.diff (40.3 KB ) - added by eriktorbjorn 19 years ago.
Patch against an April 9 CVS snapshot

Download all attachments as: .zip

Change History (10)

comment:1 by eriktorbjorn, 19 years ago

This updated version of the patch fixes the pitch problem (I was mishandling pitchbend events) and turns the gain down a bit to avoid clipping.

It still doesn't work in "multi midi" mode.

by eriktorbjorn, 19 years ago

Attachment: fluidsynth3.diff added

Patch against an April 7 CVS snapshot

comment:2 by eriktorbjorn, 19 years ago

Ah, I see. Both the FluidSynth and the Adlib driver tried to use the premix channel, but "there can be only one". This updated version fixes that.

I also noticed that there was a bug which made it sound bad unless the output sample rate was 44100 Hz. I've fixed that, too. (Note to self: in FluidSynth land, sample rate is a number, not an integer!)

comment:3 by fingolfin, 19 years ago

If it works well for you, feel free to check this in, erik. Don't forget to update the docs, though: NEWS README base/gameDetector.cpp (the --help text) maybe tools/, giving credit to you for this :-)

comment:4 by eriktorbjorn, 19 years ago

I should probably try to add a GUI for the sound font setting, too. The "Audio" tab is a big crowded already, though...

by eriktorbjorn, 19 years ago

Attachment: fluidsynth4.diff added

Patch against an April 9 CVS snapshot

comment:5 by eriktorbjorn, 19 years ago

First attempt at a "complete" patch:

* I've updated the README and LaTeX documentation. They could be made more informative, of course, but it's a start.

* I've added a "SoundFont" button to the global options dialog.

* I've added a --soundfont command-line option. (The documentation notes that this is only supported by some MIDI drivers.)

* I've added a FileBrowserDialog class and changed the name of the old BrowserDialog class to DirBrowserDialog. Ideally, both these classes should have a common ancestor, and the FileBrowserDialog should have a MacOS X version, but I haven't done any of these things.

* I've changed the < operator for the AbstractFilesystemNode class so that directories are sorted before normal files.

Can you think of anything else that needs to be added? Are the changes to the standard classes ok with you?

comment:6 by fingolfin, 19 years ago

Really tiny minor issue: In the README, you use a tab instead spaces.

As for the rest, your remarks are all on spot and *BrowserDialog should be reunified eventually, but for now, feel free to commit this.

comment:7 by eriktorbjorn, 19 years ago

Owner: set to eriktorbjorn
Status: newclosed

comment:8 by digitall, 5 years ago

Component: Audio
Note: See TracTickets for help on using tickets.