OpenTTD
评价数不足
Changing MIDI soundfont for OpenTTD on Linux
由 karafa 制作
OpenTTD plays MIDI tracks on Linux with included Fluidsynth and soundfont by default. How to change it to something else?
   
奖励
收藏
已收藏
取消收藏
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 条留言
MakkuSaiko 4 月 25 日 下午 12:03 
@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  [作者] 4 月 19 日 下午 4:14 
Thanks for sharing! VirtualMIDISynth is really neat, I love the dmusic trick as well.
MakkuSaiko 4 月 15 日 上午 11:18 
https://psteamcommunity.yuanyoumao.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 4 月 15 日 上午 10:26 
>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  [作者] 2024 年 6 月 22 日 上午 10:11 
Thanks! I'm glad you enjoy it.
Dotdotdot 2024 年 6 月 22 日 上午 10:02 
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 2023 年 11 月 22 日 上午 10:16 
My OpenTTD soundfont changed after installing the Steam version, and I have no idea where the original is...
karafa  [作者] 2023 年 1 月 7 日 下午 1:28 
Thank you, it's good to know it's still working as expected.
Captain Nathaniel J. Claw 2023 年 1 月 7 日 下午 1:12 
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  [作者] 2021 年 6 月 10 日 下午 10:26 
>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.