OpenTTD

OpenTTD

Not enough ratings
Changing MIDI soundfont for OpenTTD on Linux
By karafa
OpenTTD plays MIDI tracks on Linux with included Fluidsynth and soundfont by default. How to change it to something else?
   
Award
Favorite
Favorited
Unfavorite
Download a soundfont file
OpenTTD's Linux build for Steam uses built-in Fluidsynth for MIDI playback which supports SF2 soundfont format.

Soundfont files are widely available. You can find them under the address below:

https://musical-artifacts.com/artifacts?formats=sf2&order=most_downloaded

For example, I used OPL-3_FM_128M.sf2 soundfont. You can read about it here:

https://musical-artifacts.com/artifacts/15

https://midis.fandom.com/wiki/OPL-3_FM_128M.sf2_(OPL3_Yamaha_YMF262)
Configure OpenTTD to use the soundfont file
In your library game list: right click OpenTTD, choose Properties and find Launch Options.

There, you must enter the following:

-m fluidsynth:soundfont=<path>

Where <path> is relative to: ~/.local/share/Steam/steamapps/common/OpenTTD/

For example, you have a soundfont file saved under ~/misc/OPL-3_FM_128M.sf2, you need to change it to the following:

-m fluidsynth:soundfont="$HOME/misc/OPL-3_FM_128M.sf2"

Note: OpenTTD is unable to expand the tilde sign to your home directory location. You need to use $HOME instead.

If that doesn't work, or $HOME isn't defined on your environment - such as like SteamOS Gaming Mode - just use a full path instead:

-m fluidsynth:soundfont="/home/deck/misc/OPL-3_FM_128M.sf2"

(in this case, deck is the user name and default for SteamOS installations)
11 Comments
MakkuSaiko 25 Apr @ 12:03pm 
@karafa thanks to you as well, this guide, tho not exactly similar, helped put me on the right path to doing it on windows
karafa  [author] 19 Apr @ 4:14pm 
Thanks for sharing! VirtualMIDISynth is really neat, I love the dmusic trick as well.
MakkuSaiko 15 Apr @ 11:18am 
https://steamproxy.com/sharedfiles/filedetails/?id=3464516691

Anyone finding themselves trying to do something similar in windows, I created this guide (with images). It's still pending approval tho
MakkuSaiko 15 Apr @ 10:26am 
>Will this work on Windows?
Method for windows:
Required software: VirtualMidiSynth : https://coolsoft.altervista.org/en/virtualmidisynth#download

Steps:
1. Instal VirtualMidiSynth
2. Download Soundfont as above
3. Add soundfont to VirtualMidiSynth
Setting up OpenTTD to use the soundfont
1. Run game with command parameter: -d driver1
2. In the debug console that opens with the game, look for "Detected DirectMusic ports" and the list of devices below
3. Take note of the device nr of VirtualMIDISynth #1 [Emulated]
4. Launch game with command parameter: -m dmusic:port=X (where X is the device nr from step 3)
5. Profit
karafa  [author] 22 Jun, 2024 @ 10:11am 
Thanks! I'm glad you enjoy it.
Dotdotdot 22 Jun, 2024 @ 10:02am 
For me I put the soundfont in /home/name/Music/soundfonts/, I had no idea that OpenTTD had its own fluidsynth. I no longer have to deal with the really harsh synth the default soundfont gives. Thank You for this cool guide! :coolsam:
VBW 22 Nov, 2023 @ 10:16am 
My OpenTTD soundfont changed after installing the Steam version, and I have no idea where the original is...
karafa  [author] 7 Jan, 2023 @ 1:28pm 
Thank you, it's good to know it's still working as expected.
Captain Nathaniel J. Claw 7 Jan, 2023 @ 1:12pm 
Thanks so much for this, got it working perfectly on my Steam Deck now ($HOME command needs to be changed to /home instead but otherwise it's the same) :steamthumbsup::D
karafa  [author] 10 Jun, 2021 @ 10:26pm 
>Will this work on Windows?
OpenTTD is poorly documented and I can't find any information if Windows build of OpenTTD supports FluidSynth in any way. On Windows, I would rather give it a try and replace default MIDI with an alternative driver. Look for a thread "How to install and set up Timidity++ driver" on doomworld forums. Timidity++ can play MIDI with soundfonts, and this project allows to register it as a Windows MIDI driver. There's a chance you will also need Coolsoft MIDIMapper to set it as default MIDI output device on Windows 10.