FluidSynth-2.5.2

#### Supplemental Linux® From Scratch - Version 13.0

### Chapter 3. General Utilities

- Prev

  Flatpak-1.16.3

- Next

  G-Kermit-2.01

- Up
- Home

# FluidSynth-2.5.2

## Introduction to FluidSynth

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.

- Download: https://github.com/FluidSynth/fluidsynth/archive/v2.5.2/fluidsynth-2.5.2.tar.gz

### Additional Downloads

- Required submodule: https://github.com/kthohr/gcem/archive/012ae73c6d0a2cb09ffe86475f5c6fba3926e200/gcem-012ae73c6d0a2cb09ffe86475f5c6fba3926e200.tar.gz

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

### FluidSynth Dependencies

#### Required

CMake and one of alsa-lib, Pipewire, and/or PulseAudio

#### Recommended

D-Bus, GLib, LADSPA-SDK-1.17, libsndfile, and SDL3

#### Optional

Doxygen, Jack2, and PortAudio

## Installation of FluidSynth

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                                                &&
    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

### Important

If you are distributing, be sure to read the licenses of the soundfonts you install to ensure that they can be distributed.

## Configuring FluidSynth

### Config Files

`~/.config/fluidsynth` and `/etc/fluidsynth`

### Configuration Information

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 things you'll want to edit are the soundfont path if you haven't created the default SoundFont symlink and the startup flags. For instance, by default it will try to use ALSA, and depending on the configuration, this will probably fail. You can instead use PulseAudio or Pipewire. You can change other things too.

### Note

These files only affect FluidSynth when it starts up automatically as a Systemd service. Running FluidSynth manually, you need to specify all the options as it won't reference any of the configuration files.

## Using FluidSynth

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.

## Command Explanations

`-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.

## Contents

Installed Programs: fluidsynth
Installed Libraries: libfluidsynth
Installed Directories: /usr/include/fluidsynth, /usr/lib/cmake/fluidsynth, and /usr/share/soundfonts

### Short Descriptions

fluidsynth | is a SoundFont MIDI synthesizer
`libfluidsynth` | allows packages to synthesize MIDI

- Prev

  Flatpak-1.16.3

- Next

  G-Kermit-2.01

- Up
- Home