-
Notifications
You must be signed in to change notification settings - Fork 310
Add limiter support (with limiter from signalsmith-audio-basics) #1719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
derselbst
left a comment
There was a problem hiding this 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.
a50be14 to
fbbee3e
Compare
|
(rebased on master) |
derselbst
left a comment
There was a problem hiding this 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.
src/synth/fluid_synth.h
Outdated
| #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 */ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to 0.99999
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
fbbee3e to
07d7ccc
Compare
|
Rebased, merged changes from @derselbst and set FLUID_LIMITER_DEFAULT_OUTPUT_LIMIT to 0.99999 |
abed148 to
7dec023
Compare
Otherwise, the signalsmith-audio-basics won't build, and it is needed for limiter support
a783ed4 to
1b49398
Compare
|
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) |
|
To fix builds, needed to change Also updated link to mingw to use newer version that supports c++20 |
|
macos builds seem to fail because of some intermittent error unrelated to the code |
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