Ambrose Li

Beware of your fluidsynth gain setting

Beware of your fluidsynth gain setting. This was what I found out yesterday.

In short, if you run fluidsynth with a low gain (such as the default of 0.2) and strike a note with a high MIDI velocity, you can get a different sound than running the synth with a higher gain (e.g., around 0.5) and strike a note with a lower MIDI velocity. Even if the two notes come out at roughly the same loudness (I checked this with a software meter, japa[Note 1] specifically), the resulting sounds can be different different texture, different quality.

I discovered this while trying to calibrate mf for my chiming clock to peak at roughly +0 dB LU, but now I can’t reproduce it. I don’t know what gain settings I used a day ago, what soundfont I used, or what velocities.

Without reading the code, I’m assuming if a soundfont includes different samples for soft and loud sounds for an instrument, fluidsynth might be using MIDI velocity to figure out what sample to play, so a note struck at low velocity will have a “soft” sample played, while a note struck at a higher velocity will have a “loud” sample played, thus explaining the difference in sound quality.


  1. Kokkini Zita, “Linux Audio projects at Kokkini Zita,” accessed March 4, 2022, http://​kokkinizita​.linuxaudio​.org/​linuxaudio/​index​.html.