User:Gavlee/Draft:FluidSynth
FluidSynth is a real-time software wave-table MIDI synthesizer capable of playing audio samples in the SoundFont instrument format. The software is very flexible due to being originally designed to be included in games as an audio engine.
Installation
There are a few steps required to set up FluidSynth, this will be highly dependent on what is desired to be achieved and on hardware support.
Kernel
Depending on which functions are required certain kernel options may need to be enabled. For instance to render a MIDI file to WAV audio file format no kernel support would be needed. However if FluidSynth is to be controlled real-time with input from a MIDI keyboard and direct output to a sound card, MIDI support and sound card support will need to be enabled in the kernel or built as a module. There is a MIDI controller guide and detailed documentation to set up ALSA for sound cards. It's important this hardware support is functional and stable before attempting to run FluidSynth, especially for real-time usage.
USE flags
Deciding on appropriate USE flags is important for the correct support to be able to control FluidSynth and for it to output to the desired audio back-end. For real-time support and for interoperability with other audio applications, enabling JACK support is highly recommended. For output to different audio file formats for rendering, enable sndfile.
USE flags for media-sound/fluidsynth Software real-time synthesizer based on the Soundfont 2 specifications
+readline
|
Enable support for libreadline, a GNU line-editing library that almost everyone wants |
+sndfile
|
Add support for libsndfile |
alsa
|
Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture) |
dbus
|
Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc) |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
doc
|
Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally |
ipv6
|
Add support for IP version 6 |
jack
|
Add support for the JACK Audio Connection Kit |
ladspa
|
Enable the ability to support ladspa plugins |
network
|
enable network support (requires BSD sockets) |
oss
|
Add support for OSS (Open Sound System) |
pipewire
|
enable media-video/pipewire support |
portaudio
|
Add support for the crossplatform portaudio audio API |
pulseaudio
|
Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire) |
sdl
|
Add support for Simple Direct Layer (media library) |
systemd
|
Enable use of systemd-specific libraries and features like socket activation or session tracking |
threads
|
Add threads support for various packages. Usually pthreads |
Emerge
root #
emerge --ask media-sound/fluidsynth
Configuration
Usage
FluidSynth can be invoked in various modes to perform differently. Research the FluidSynth options and decide which input and output devices best suit the environment and the performance.
Invocation
Some examples follow for fast rendering a MIDI file to an audio file and for real-time use with ALSA and JACK. Fluidsynth also supports playing through PulseAudio and many other back-ends with portaudio and SDL.
Fast render MIDI file
user $
fluidsynth --fast-render=output.wav MyFavoriteSoundFont.sf2 MyFavoriteGMFile.mid
Real-time (ALSA)
user $
fluidsynth
Real-time (JACK)
user $
fluidsynth
PulseAudio
user $
fluidsynth
Troubleshooting
Removal
No special removal instructions are necessary, a regular emerge depclean will suffice to clean the system.
Unmerge
root #
emerge --ask --depclean --verbose media-sound/fluidsynth
See also
External resources
- https://qsynth.sourceforge.io/ - Qsynth is a GUI frontend for FluidSynth based on Qt.
- https://en.wikipedia.org/wiki/SoundFont - Information about the SoundFont specification on Wikipedia.