FluidSynth provides a SoundFont 2 and 3 software synthesizer. It can take in MIDI input and can playback MIDI files. Several packages make use of this package for both the MIDI input and playback capabilities.
You will need at least one SoundFont/bank at runtime, which FluidSynth uses. Which one you'll want is up to personal preference and your needs. The following download contains two generic banks for you to use.
Recommended SoundFont: https://deb.debian.org/debian/pool/main/f/fluid-soundfont/fluid-soundfont_3.1.orig.tar.gz
CMake and one of alsa-lib, Pipewire, and/or PulseAudio
D-Bus, GLib, LADSPA-SDK-1.17, libsndfile, and SDL3
After unpacking the FluidSynth tarball and entering the directory, unpack the required GCEM submodule:
tar -xf ../gcem-012ae73c6d0a2cb09ffe86475f5c6fba3926e200.tar.gz && mv -T gcem-012ae73c6d0a2cb09ffe86475f5c6fba3926e200 gcem
Install FluidSynth by running the following commands:
mkdir build &&
cd build &&
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_SKIP_INSTALL_RPATH=ON \
-D FLUID_DAEMON_ENV_FILE=/etc/fluidsynth \
-W no-dev -G Ninja .. &&
ninja
To run the tests, issue ninja check.
Now, as the root user:
ninja install && install -vDm644 fluidsynth.conf /etc/fluidsynth && install -vDm644 fluidsynth.service -t /usr/lib/systemd/user/ && install -vDm644 fluidsynth.tmpfiles /usr/lib/tmpfiles.d/fluidsynth.conf
In order for FluidSynth to provide instrumentals during MIDI playback, it needs a SoundFont, or a bank or collection of banks, to provide the instruments.
Install the recommended SoundFonts as the root user:
tar -xf ../../fluid-soundfont_3.1.orig.tar.gz && install -vDm644 fluid-soundfont-3.1/*.sf2 -t /usr/share/soundfonts/
By default, FluidSynth will read from /usr/share/soundfonts/default.sf2 unless
specified otherwise. It will be up to you to decide which SoundFont
you want to set as the default. Creating the symlink must be done
as root, as so:
ln -svf <SOUNDFONT> /usr/share/soundfonts/default.sf2
If you are distributing this package as part of a distribution, be sure to read the licenses of the soundfonts you install to ensure that they can legally be distributed. If you are in doubt, please contact your lawyer.
The system-wide default configuration file is /etc/fluidsynth and should be edited as
root to suit your needs. However,
a per-user configuration file can be created as well with the
following command:
mkdir -pv ~/.config && cp -v /etc/fluidsynth ~/.config/fluidsynth
The main configuration values you'll want to edit are the soundfont path (if you haven't created the default SoundFont symlink), and the startup flags. For instance, FluidSynth will default to using ALSA, and depending on the system's configuration, this may fail. You can instead use PulseAudio or Pipewire. There are several other options that you can set in this configuration file as well.
These files only affect FluidSynth when it starts up automatically as a Systemd service. If you run FluidSynth manually, you need to specify all the options as it won't reference any of the configuration files.
Some applications that utilize FluidSynth expect it to be running before the application is launched. If FluidSynth isn't started prior to the application, the application may not be able to connect to FluidSynth.
RoseGarden behaves this way, both from source and as a Flatpak, but as long as FluidSynth is started first, RoseGarden is able to use FluidSynth.
-D
CMAKE_SKIP_INSTALL_RPATH=ON: This switch makes
cmake remove
hardcoded library search paths (rpath) when installing a binary
executable file or a shared library. This package does not need
rpath once it's installed into the standard location, and rpath may
sometimes cause unwanted effects or even security issues.
-D
FLUID_DAEMON_ENV_FILE=/etc/fluidsynth: This parameter
hardcodes the location of the configuration file to be in an easier
and more consistent path.