Hello Dries,

The specifications of sf2 format do not describe clearly the functions used for the convex / concave forms. I read the fluidsynth sources and here is what I found:

First let's consider these concave and convex functions:

concave(0) = 0

concave(value) = -(20 / 96) * log ((127-value)^2 / 127^2) / log (10) value varying between 1 and 126 included

concave(127) = 1

convex(0) = 0

convex(value) = 1 + (20 / 96) * log (value^2 / 127^2) / log (10) value varying between 1 and 126 included

convex(127) = 1

The different values are then computed as follows:

convex(input) | convex(127 - input)
------------------------------------------
concave(input) | concave(127 - input)

Davy

Sources:

http://sourcecodebrowser.com/fluidsynth/1.0.8/fluid__conv_8c_source.html lines 00070 to 00086

https://github.com/jnetterf/creator-live/blob/master/3rd-fluidsynth/src/fluid_mod.c lines 208 to 231