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
Now, as the root user:
ninja install && cp -v fluidsynth.conf /etc/fluidsynth
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 -vdm755 /usr/share/soundfonts && install -vm644 fluid-soundfont-3.1/*.sf2 /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, be sure to read the licenses of the soundfonts you install to ensure that they can be distributed.
For some applications that utilize FluidSynth, they expect it to be running before the application is started. If FluidSynth is started after the fact, the application may not be able to reach FluidSynth.
RoseGarden behaves this way, both from source and as a Flatpak, but once FluidSynth is started beforehand, 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
makes the config file hardcoded to be in a simple path.