Software synthesizer based on the SoundFont 2 specifications
Find a file
derselbst 44453ff232 Ensure the reverb engine is initialized after synth creation
The parameters (roomsize, level, etc.) of the reverb effects unit are initialized at the very end of `new_fluid_synth()` with `fluid_synth_set_reverb_full_LOCAL()`.
This however only adds an update-event to the `rvoice_mixer` queue.
The call to `fluid_synth_process_event_queue()` in `new_fluid_synth()` should make sure, that this event is dispatched and triggers the actual update.
However, the event is not dispatched immediately, because the rvoice event queue has not been committed yet, that is, a call to `fluid_rvoice_eventhandler_flush()` is missing.

So, although a reverb param initialization event has been queued, the reverb params still are garbage initialized (on Windows to some `-6.2774385622041925e+66`).

The next call to through the synth's public API will flush the queue and finally dispatch the update event, but when will it happen?

1. If the soundfont is specified as command-line argument, this call will happen before the audio driver starts rendering.
2. If the soundfont is loaded via shell command `load`, the audio driver will first start rendering audio, after updating the reverb.

Case 1. is trivial, everything works as it should.
Case 2. is interesting. Since the synth already started rendering audio by using that uninitialized reverb unit, the reverb engine's internal buffer is completely filled up with noise. Before outputting that signal to sound card, the sound is clipped to `1.0f`. That's the click we hear at the beginning. And because the reverb is so loud, the rendered audio signal stays 1.0f for quite a long time (...or always, can't tell).

Why is it not reproducible on Linux? Because GCC and Clang (AFAIK) leave all values uninitialized after allocating memory. And because malloc() often return zero-initialized memory, the reverb params seem to be nicely zero-initialized. MSVC however, always initializes memory with garbage, which is why we "hear" this resonance disaster.

Solution: Just update the reverb params via public API, which implicitly calls `fluid_rvoice_eventhandler_flush()`.

Fixes #563.
2019-09-27 14:01:40 +02:00
.github update issue_template.md 2018-09-03 21:08:34 +02:00
cmake_admin fix build 2019-08-09 09:00:03 +02:00
doc bump to 2.0.7 2019-09-24 16:23:55 +02:00
include Add a public wrapper function for free() (#562) 2019-09-24 16:14:34 +02:00
sf2 remove VintageDreamsWaves-v2.sf3 2019-03-24 17:25:57 +01:00
src Ensure the reverb engine is initialized after synth creation 2019-09-27 14:01:40 +02:00
test fix build with MSVC 2019-04-17 19:20:36 +02:00
.appveyor-vcpkg.yml Import CI build scripts from master 2019-08-08 21:57:20 +02:00
.azure-pipelines.yml Import CI build scripts from master 2019-08-08 21:57:20 +02:00
.cirrus.yml Import CI build scripts from master 2019-08-08 21:57:20 +02:00
.clang-format cmake: setup formatting targets 2018-06-24 12:59:46 +02:00
.clang-tidy clang-tidy: remove annoying readability-inconsistent-declaration-parameter-name 2018-10-28 14:21:36 +01:00
.gitignore add gitignore 2017-09-23 18:17:40 +02:00
.travis.yml Import CI build scripts from master 2019-08-08 21:57:20 +02:00
AUTHORS Update polymono doc and AUTHORS files (#428) 2018-09-12 12:10:29 +02:00
ChangeLog remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
CMakeLists.txt bump to 2.0.7 2019-09-24 16:23:55 +02:00
CONTRIBUTING.md add style guide related notes to CONTRIBUTING.md 2018-03-24 14:35:52 +01:00
fluidsynth.conf.in add systemd service files 2018-02-20 21:31:35 +01:00
fluidsynth.pc.in remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
fluidsynth.service.in Improve systemd integration 2019-03-02 10:18:32 +01:00
fluidsynth.spec.in remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
LICENSE move README and LICENSE to top-level dir 2017-07-27 12:11:26 +02:00
NEWS remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
README-OSX update READMEs 2018-06-15 18:38:21 +02:00
README.cmake.md Update and rename README.cmake to README.cmake.md 2018-06-15 17:47:12 +02:00
README.md add MinGW build badge to ReadMe 2019-02-22 10:10:53 +01:00
THANKS remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
TODO cleanup TODO 2018-08-16 11:06:11 +02:00

FluidSynth

Build Status glib < 2.30 glib >= 2.30
Linux/MacOSX n.a. Build Status Travis
FreeBSD n.a. Build Status
Windows (VisualStudio) Build status Appveyor Build status
Windows (MinGW) Build status n.a.

FluidSynth is a software real-time synthesizer based on the Soundfont 2 specifications.

OHLOH Project Stats

FluidSynth reads and handles MIDI events from the MIDI input device. It is the software analogue of a MIDI synthesizer. FluidSynth can also play midifiles using a Soundfont.

Information on the web

The place to look if you are looking for the latest information on FluidSynth is the web site at http://www.fluidsynth.org/.

For documentation, please see the links below.

For information on how to build FluidSynth from source, please see our wiki page.

Why did we do it

The synthesizer grew out of a project, started by Samuel Bianchini and Peter Hanappe, and later joined by Johnathan Lee, that aimed at developing a networked multi-user game.

Sound (and music) was considered a very important part of the game. In addition, users had to be able to extend the game with their own sounds and images. Johnathan Lee proposed to use the Soundfont standard combined with an intelligent use of midifiles. The arguments were:

  • Wave table synthesis is low on CPU usage, it is intuitive and it can produce rich sounds

  • Hardware acceleration is possible if the user owns a Soundfont compatible soundcard (important for games!)

  • MIDI files are small and Soundfont2 files can be made small thru the intelligent use of loops and wavetables. Together, they are easier to downloaded than MP3 or audio files.

  • Graphical editors are available for both file format: various Soundfont editors are available on PC and on Linux (Smurf!), and MIDI sequencers are available on all platforms.

It seemed like a good combination to use for an (online) game.

In order to make Soundfonts available on all platforms (Linux, Mac, and Windows) and for all sound cards, we needed a software Soundfont synthesizer. That is why we developed FluidSynth.

Design decisions

The synthesizer was designed to be as self-contained as possible for several reasons:

  • It had to be multi-platform (Linux, MacOS, Win32). It was therefore important that the code didn't rely on any platform specific library.

  • It had to be easy to integrate the synthesizer modules in various environements, as a plugin or as a dynamically loadable object. I wanted to make the synthesizer available as a plugin (jMax, LADSPA, Xmms, WinAmp, Director, ...); develop language bindings (Python, Java, Perl, ...); and integrate it into (game) frameworks (Crystal Space, SDL, ...). For these reasons I've decided it would be easiest if the project stayed very focussed on it's goal (a Soundfont synthesizer), stayed small (ideally one file) and didn't dependent on external code.

Home Page

Documentation

Software SoundFont Synthesizers:

Soundfont Editors

Conversion Tools

Soundfont Databases