-
-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIDI playback support with custom SoundFonts #3613
base: main
Are you sure you want to change the base?
Conversation
Pylint result on modfied files:
|
Just a question, apologies as I haven't built & tested myself. Is the scope for the whole bottle only, or can the options be set per program? My use-case would be to have multiple shortcuts to the same game in the same bottle with different soundfonts. |
@keenanweaver Funnily enough, right now it's actually the other way around: you are able to set different soundfonts for each program (i.e what you need), but there isn't a global soundfont chooser. Shouldn't be hard though to add that option in a commit up next. I'm just not sure yet about bundling a default one. |
I'm pretty much all Nuked SC55 these days, but before that I used the Trevor0402 SC-55 soundfont. It's really tough finding a 'universal' soundfont when it sounds incredible in one game and terrible in another. Like most things, my default barometer is Doom--if it sounds good there, it probably sounds good in other games. I'm of the opinion one shouldn't be bundled in here. People that will use this feature know what they're wanting, and those dipping their toes into the soundfont pond for the first time will easily find discussions and recommendations all over the web. |
I like the reasoning. On the one hand, it could feel kinda incomplete not having a required feature working out-of-the-box. On the other hand, MIDI audio playing by default would make some people unaware of even the option to swap it for a custom soundfont ("this game sounds so bad and apparently I can't do anything about it" moment). For the best of both worlds, perhaps we could simply leave the default setting empty ( |
fd109b5
to
e0613a1
Compare
e0613a1
to
75f1462
Compare
4205cfc
to
d442151
Compare
013a6c7
to
a1c9b2b
Compare
I think that's it. All functionalities should work as described. As for the rest, a global MIDI settings menu is in the plans. We can then have stuff like:
But that's definitely better left for another PR further on. This one got too |
Done through garbage collector's reference counting. In case of multiple programs running with the same soundfont at once, instance is only terminated after ALL of them exit.
Description
Introducing a new launch option as a GUI-oriented user-friendly way to deal with MIDI playback, for programs (mainly old games) that contain MIDI sequencer audio tracks.
Makes use of FluidSynth as MIDI synthesizer, and
PipeWireALSA as the audio driver (though PulseAudio and Pipewire also work). An user-supplied SoundFont file is required (either in.sf2
or.sf3
formats — both tested to work). This allows different games to be run individually and simultaneously with distinct instrument sets.A registry add/update is also applied, to make the game pick the right instrument set at launch (when more than one fluidsynth instance is running at once). See: https://gitlab.winehq.org/wine/wine/-/wikis/MIDI#selecting-the-output---the-midi-mapper
Of course, and most importantly, this PR will probably require
fluidsynth
libfluidsynth
and its related libraries to be bundled as part of Bottles's flatpak. Correlated issue: flathub/com.usebottles.bottles#466Type of change
How Has This Been Tested?
First of all, make sure
fluidsynth
is installed on your systemlibfluidsynth
and its related libraries (libinstpatch-1.0
,libportaudio
,libportaudiocpp
) are installed and reachable from the flatpak sandbox.Set the
MIDI SoundFont
launch option for a MIDI-driven game, choosing a .sf2/.sf3 file as you wish. MIDI playback should now work and a FluidSynth server will start upon launch.Setting another SoundFont for a different game — and running it without closing the first — will have said game playing audio with the second instrument set, by running another FluidSynth instance. Both should coexist without interference.
Closing any of the games should kill the respective fluidsynth instance. Further loaded instances will be given the vacant IDs of past ones (e.g by having three distinct-SoundFont open games — #0, #1 and #2 — and closing the one with instrument set #1, next game with unique SoundFont will be given ID #1).