Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1255 - Leveler effect not fit for purpose
Leveler effect not fit for purpose
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Built-in FX
2.1.2
Per OS All
: P4 Enhancement
Assigned To: Steve Daulton
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-30 07:03 UTC by Steve Daulton
Modified: 2018-08-20 11:51 UTC (History)
6 users (show)

See Also:
Steps To Reproduce:
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2015-10-30 07:03:57 UTC
The designed purpose of the Leveler effect is:
"a simple, combined compressor and limiter effect for reducing the dynamic range of audio."

The Leveler effect is actually a "waveshaper" (https://en.wikipedia.org/wiki/Waveshaper) and as such is unsuitable for its intended purpose.

For reducing dynamic range, the Compressor and/or Limiter effects should be used.

The Leveler effect does have one other use, and that is as a "distortion" effect. However, as a distortion effect it is badly named and very limited.

As we now have a simple to use Limiter effect, the Limiter effect should imo be renamed as a distortion effect and enhanced to become a more versatile waveshaping distortion effect.
Comment 1 Gale Andrews 2015-10-30 14:33:59 UTC
And... to help those use Limiter to reduce dynamic range because the built-in Compressor is too complex/does not behave like a textbook compressor, add a more simple Compressor (or better, Compressor/Expander). 

Steve's unadvertised Expander that was once part of an experimental Compressor/Expander is the best expander I have ever used. :=)
Comment 2 Peter Sampson 2015-11-04 15:41:02 UTC
Bill wrote in the ednote on the Leveler page in the Manual back on 27Aug2012: 

"I would hope that the Leveler will soon be dropped from Audacity. If I understand the history correctly, this was added for use with CleanSpeech at a quick and dirty (very dirty!) compressor that could be used in a chain. It introduces unacceptable distortion (IMO) when used as a compressor. It has some (very limited) use as a "distorted vocal" effect. So, I'd rather lobby for its removal rather than spend more time documenting it."

I'm minded to agree with him - and with Steve
Comment 3 Peter Sampson 2016-02-01 04:25:51 UTC
James as a TL member added his approval for the removal of this effect via an email thread discussing Leveller/Leveler.
Comment 4 Peter Sampson 2016-02-01 04:26:15 UTC
And if we do remove it should we be considering adding it to the
list of available plug-ins on the Wiki (just in case we get complaints
from users who use this)?
Comment 5 Steve Daulton 2016-02-01 08:45:50 UTC
(In reply to Peter Sampson from comment #4)
I am intending to make "Leveler" (or "Leveller") one of the options in the new "Distortion" effect. The Distortion effect that I am currently working on is a "waveshaper" (https://en.wikipedia.org/wiki/Waveshaper). The Leveler effect is also a waveshaper.

The new effect replaces the multi-choice controls with text box and slider controls, which allows greater control. Rather than just 6 "amount" settings, the new version has an "amount" slider which again allows greater control and a greater range of "heaviness". Unlike the Leveler, the effect is always applied in a single pass (the Leveler uses multiple passes to produce a "heavier" effect), so it should be faster and more efficient on heavy setting than the Leveler.

The new Distortion effect can be thought of as a much enhanced version of the Leveler effect that has been named more appropriately.

I don't buy into the argument that "moving the Leveler effect into a Distortion effect is a regression because naive users will not be able to find it". If a user does not know that the Leveler is a distortion effect, then they are not only naive but are misguided and at risk of inadvertently damaging their work. By calling it a distortion effect, we are conveying vital information to users.
Comment 6 Steve Daulton 2016-04-13 09:32:48 UTC
(In reply to Steve Daulton from comment #5)
Looking at the code for the Leveller / Leveler effect, the reason why this effect is so bad becomes apparent:

How the effect "should" work:

1) EffectLeveller::CalcLevellerFactors()
Create a "gain map" to define the amount of gain to apply according to the input level.

2) EffectLeveller::ProcessBlock()
Send "frames" from the input buffer to LevelOneFrame(frame) for processing.

3) EffectLeveller::LevelOneFrame(float frameInBuffer)
Apply gain to the "frameInBuffer" according to the "gain map" and return the processed audio to the output buffer.


The problem:

The effect does not and never has done what it was intended to do because there is no implementation of "frames". Rather than sending a "frame" from ProcessBlock() to LevelOneFrame(), individual samples are sent.

Because the gain is adjusted "per sample" rather than "per frame", the effect acts as a "waveshaping distortion effect" rather than as a "dynamic compression effect".


Summary:

The effect code is incomplete, so it has never worked correctly.
The effect 'could' be completed to perform the effect that was originally intended, but that would dramatically change what the effect does and what it sounds like, so it would be misleading to retain the name Leveler / Leveller.
Comment 7 Gale Andrews 2016-04-15 18:38:41 UTC
(In reply to Steve Daulton from comment #6)
So as assignee, Steve, are you going to give us a proper distortion effect and a simple compressor/expander?
Comment 8 Steve Daulton 2016-04-16 07:09:21 UTC
(In reply to Gale Andrews from comment #7)
As assignee for bug 1255 I intend to remove the "Leveller" menu item and replace it with a "Distortion" menu item. The "Distortion" menu item will open a new effect which will be a "waveshaping distortion" effect.

To avoid a regression, the new effect will include the algorithm used by the current "Leveller" effect as one of its settings. This setting will be called "Leveller". The "Distortion" effect will include additional settings.

As far as I'm aware, this new effect will be the first built-in distortion effect in Audacity and will be subject to improvements and further development in the future. It will provide substantial improvements over the current "Leveller" for the purpose of applying waveshaping distortion.

----------------

We currently ship two effects for reducing dynamic range, namely the "Compressor" and "Limiter" effects. Whether we want a third effect for changing the dynamic range is a discussion that we could have on ~quality mailing list. Such a discussion goes beyond the intended scope of bug 1255.

I am interested in exploring the potential of a new dynamic range compression effect utilizing the transformation map of the current "Leveller" effect. That will be a dynamic range compression effect along the lines of what appears to have been the originally intended process of the "Leveller" effect. I don't consider this exploration to be the subject of bug 1255, but could be part of a new "enhancement" subject to the outcome of discussions about whether we need more dynamic range effects in Audacity. I am also interested in developing the "Limiter" effect as a built-in effect with real-time preview.
Comment 9 Steve Daulton 2016-07-06 05:11:55 UTC
Marked as "resolved" as the Leveler (Leveller) effect has been replaced with a waveshaper distortion effect.