Skip to content

Conversation

@neoharp-dev
Copy link
Contributor

This adds limiter support by using Signalsmith Audio Basics C++ header-only library (see https://signalsmith-audio.co.uk/code/ and https://github.com/Signalsmith-Audio/basics)

Path to Signalsmith basics lib have to be supplied to cmake in the environment variable SIGNALSMITH_AUDIO_BASICS_PATH

The limiter is applied in fluid_rvoice_mixer_process_fx after chorus and reverb effects. In the audio drivers that mix effects and dry audio in one buffer, the limiting will be applied to the resulting buffer. In audio drivers that do this separately (for example, Jack driver), the limiting will be applied only to the dry buffer

Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks in advance! I had no chance to test this and probably won't have until late December. So, patience pls. :) One typo below.

@neoharp-dev neoharp-dev force-pushed the add-limiter-support branch 2 times, most recently from a50be14 to fbbee3e Compare December 21, 2025 14:44
@neoharp-dev
Copy link
Contributor Author

(rebased on master)

Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played around with that in the past days a bit and it works quite fine. I've made several changes but were unable to push them to your branch, so I put them here. Pls. merge it, I'll need to think about which commits will survive in the end (not quite done yet).

Basically, signalsmith-audio is now a submodule to simplify building it. They require C++20 because of std::atomic_flag::test(), fixed that as well. I have documented (and renamed) the new settings, pls. have a look. I have removed synth.limiter.input-gain , because that's the job of synth.gain.

#define FLUID_LIMITER_DEFAULT_ATTACK_MS 5.0f /**< Default attack in milliseconds */
#define FLUID_LIMITER_DEFAULT_HOLD_MS 15.0f /**< Default hold in milliseconds */
#define FLUID_LIMITER_DEFAULT_RELEASE_MS 40.0f /**< Default attack in milliseconds */
#define FLUID_LIMITER_DEFAULT_OUTPUT_LIMIT 0.999f /**< Default output limit */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason to define the limit at 0.999? Because when using int16, this only gives a max range of 0.999*32766 = 32733. I would at least go with 0.9999 or even 0.99999, such that by default we get the biggest dynamic range possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to 0.99999

neoharp-dev and others added 14 commits January 9, 2026 16:06
This adds limiter support by using Signalsmith Audio Basics C++
header-only library (see https://signalsmith-audio.co.uk/code/ and
https://github.com/Signalsmith-Audio/basics)

Path to Signalsmith basics lib have to be supplied to cmake in the
environment variable SIGNALSMITH_AUDIO_BASICS_PATH

The limiter is applied in fluid_rvoice_mixer_process_fx after
chorus and reverb effects. In the audio drivers that mix effects
and dry audio in one buffer, the limiting will be applied to the
resulting buffer. In audio drivers that do this separately (for
example, Jack driver), the limiting will be applied only to the
dry buffer
@neoharp-dev
Copy link
Contributor Author

Rebased, merged changes from @derselbst and set FLUID_LIMITER_DEFAULT_OUTPUT_LIMIT to 0.99999

Otherwise, the signalsmith-audio-basics won't build, and it is
needed for limiter support
@neoharp-dev
Copy link
Contributor Author

neoharp-dev commented Jan 9, 2026

Fixed almost all builds.

SonarCloud workflow is failing for unrelated reason.

Solaris build fails because of the problem in signalsmith audio dsp submodule. I created PR there, hopefully author will accept and this should fix the build for Solaris. (PR: Signalsmith-Audio/dsp#1)

@neoharp-dev
Copy link
Contributor Author

neoharp-dev commented Jan 9, 2026

To fix builds, needed to change submodule: true to submodule: recursive in all build configurations, and also use temporary double variable for the limiter settings getting, to avoid problems of float/double mismatch

Also updated link to mingw to use newer version that supports c++20

@neoharp-dev
Copy link
Contributor Author

macos builds seem to fail because of some intermittent error unrelated to the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

32-bit float Rendering with Automatic Gain Control/Output Leveller on final stage

2 participants