You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FluidSynth's "gain" is very variable depending on a myriad of possible situations; The programs in the Sound Font used being too loud over others; the MIDI setting Channel volumes very high overall or also playing voices with maximum volume/velocity. Clipping can end up happening at a moments notice and the only way around it is to manually adjust gain when it happens, and keep adjusting it until the clipping stops for that particular song. The gain might be too soft for one song but too loud for others.
Describe the solution you'd like
I feel like the best possible solution is if FluidSynth is rendering in a pure 32-bit floating point sample environment, something at the end of the rendering stage could dynamically soft-level the samples so that they don't clip/distort when finally mixed to 16-bit or 24-bit sample formats used by whatever sound hardware being used with FluidSynth. A automatic gain control/soft-leveler would allow one to just leave the "gain" variable at 1.0 without having to adjust it all the time. The dynamic range of the resulting audio will obviously suffer from this but I feel it's better than hard distortion and crackling that clipping results in.
OpenAL Soft has such a system in place that can be enabled with the output-limiter variable being set to true under [general] with a $HOME/.alsoftrc or alsoft.conf configuration file. OpenAL Soft also performs all audio rendering with 32-bit floating point samples. The output-limiter ensures that the amplitude of the resulting audio samples is low enough to not clip when finally output as 24-bit or 16-bit depending on the sound device.
This feature should also similarly to OpenAL Soft be a configurable option for users that do not need such automatic gain control/soft-leveling in instances the dynamic range of the audio needs to remain intact; e.g. for file rendering purposes.
Describe alternatives you've considered
I've experimented with running FluidSynth with a low gain value but having a process perform the leveling afterward, but if clipping still somehow happens, the clipping is still present. In addition; there's noticeable "hissing" because of quantization error from performing volume amplification+leveling already operating on samples being received in 16-bit in my particular use case.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
FluidSynth's "gain" is very variable depending on a myriad of possible situations; The programs in the Sound Font used being too loud over others; the MIDI setting Channel volumes very high overall or also playing voices with maximum volume/velocity. Clipping can end up happening at a moments notice and the only way around it is to manually adjust gain when it happens, and keep adjusting it until the clipping stops for that particular song. The gain might be too soft for one song but too loud for others.
Describe the solution you'd like
I feel like the best possible solution is if FluidSynth is rendering in a pure 32-bit floating point sample environment, something at the end of the rendering stage could dynamically soft-level the samples so that they don't clip/distort when finally mixed to 16-bit or 24-bit sample formats used by whatever sound hardware being used with FluidSynth. A automatic gain control/soft-leveler would allow one to just leave the "gain" variable at 1.0 without having to adjust it all the time. The dynamic range of the resulting audio will obviously suffer from this but I feel it's better than hard distortion and crackling that clipping results in.
OpenAL Soft has such a system in place that can be enabled with the
output-limiter
variable being set totrue
under[general]
with a$HOME/.alsoftrc
oralsoft.conf
configuration file. OpenAL Soft also performs all audio rendering with 32-bit floating point samples. Theoutput-limiter
ensures that the amplitude of the resulting audio samples is low enough to not clip when finally output as 24-bit or 16-bit depending on the sound device.This feature should also similarly to OpenAL Soft be a configurable option for users that do not need such automatic gain control/soft-leveling in instances the dynamic range of the audio needs to remain intact; e.g. for file rendering purposes.
Describe alternatives you've considered
I've experimented with running FluidSynth with a low gain value but having a process perform the leveling afterward, but if clipping still somehow happens, the clipping is still present. In addition; there's noticeable "hissing" because of quantization error from performing volume amplification+leveling already operating on samples being received in 16-bit in my particular use case.
The text was updated successfully, but these errors were encountered: