Page 2 of 3

Re: Distortion effects

Posted: Sun Nov 04, 2012 11:50 pm
by steve
Here's the soft clipping plug-in: http://forum.audacityteam.org/viewtopic ... 28#p162128

Here is Edgar's "broadcast limiter IV" http://forum.audacityteam.org/download/file.php?id=2883
I think there is a minor bug in the broadcast limiter which could do with fixing so that it can be uploaded to the wiki. I think that Edgar has abandoned this plug-in so you're quite at liberty to fix it if you have the time and inclination. There's a brief note about the bug here: http://forum.audacityteam.org/viewtopic ... 67#p170867

Re: Distortion effects

Posted: Thu Nov 08, 2012 4:46 pm
by Robert J. H.
Ok, I've taken a first look at the broadcast limiter by Edgar.
Since compressors and limiters are not in my province, I have to put some questions to you (Steve or others).
There are three controls:
  • Threshold
  • Knee
  • Limit "Output Level"
As you can imagine, it's hard to find a bug if you don't know what the plug-in is supposed to do or rather, how it should react to the different settings.
First of all, threshold seems to me an unlucky name. The control goes from 0.05 to 1.0. Normally, I would expect threshold to be a dB unit and the effect takes effect about this value. By entering 0.5, the plug-in will amplify the whole signal by 6 dB or a factor of two. This seems to indicate that "threshold" is rather a ratio (1:2). Either we change the name to ratio with the same value range or substitute it with an amplification slider (in dB). By the by, the code defines "amplication" as 1/threshold.

Then there is the "Limit" control from -20 to 0 dB. Since the official name is "Output Level" one might expect that the maximum sample value will be the linear expression of this control (i.e. -3 dB = +/- 0.707 max. sample value). This seems to work if half of the knee value doesn't exceed the limit value. This means, if you choose 0 dB as the target output level and a knee of 3 dB, the max resulting sample value will be 0.947421 instead of 1.0.
Is this the bug we are looking for? Shouldn't the output level always be the value defined by the user and the knee start at -3 dB(in the case above)?
I suggest the following corrections:
  • "threshold" will be changed to either "ratio" or "Amplification"
  • "Knee" is changed to "Knee (Range)"
  • "Output level" stays the same but the code is such modified that this value is always respected.
I am not sure wheter the input signal should not be better normalized prior to the limiter application. This applies in particular to input signals that are above 0 dB (those peaks are simply hard-clipped). If we do that, the third control could also be named "Min Headroom". On the other Hand, if a Signal below 0 dB is also normalised, this control could alternatively be named "Target Gain" (negative dB) or "headroom" (positive dB), since the output is now absolute.
I don't know yet if the knee function returns the right values, that's hard to tell from the sample values alone.

Re: Distortion effects

Posted: Thu Nov 08, 2012 6:19 pm
by steve
Robert J. H. wrote:First of all, threshold seems to me an unlucky name. The control goes from 0.05 to 1.0. Normally, I would expect threshold to be a dB unit and the effect takes effect about this value. By entering 0.5, the plug-in will amplify the whole signal by 6 dB or a factor of two. This seems to indicate that "threshold" is rather a ratio (1:2). Either we change the name to ratio with the same value range or substitute it with an amplification slider (in dB). By the by, the code defines "amplication" as 1/threshold.
Yes I see what you mean. I think that I'd change the name of the slider control, possibly something like "Amplification Ratio"?

Robert J. H. wrote:Then there is the "Limit" control from -20 to 0 dB.
That should be a range of -6 to 0 dB.
Are you sure that you have the correct version?
Here is the link again: http://forum.audacityteam.org/download/file.php?id=2883
The name of the effect is "Broadcast Limiter IV..."

Re: Distortion effects

Posted: Thu Nov 08, 2012 6:42 pm
by steve
From a quick look, I think the bug is in the function coord.

The maximum value when (cond t should be equal to linear-limit so that there is a smooth curve.

Re: Distortion effects

Posted: Fri Nov 09, 2012 9:00 am
by Gale Andrews
Robert J. H. wrote:My vote is definetly in when it comes to adding distortion effects to the built-in ones.
OK then that is two votes (including Steve's vote) for a shipped "tube distortion" suitable for voices and guitars.


Gale

Re: Distortion effects

Posted: Fri Nov 09, 2012 10:52 am
by steve
Gale Andrews wrote:OK then that is two votes (including Steve's vote) for a shipped "tube distortion" suitable for voices and guitars.
My vote is not specifically for "tube distortion" but rather a distortion effect that offers a range of creative possibilities (not just "clipping").

Re: Distortion effects

Posted: Fri Nov 09, 2012 2:09 pm
by Robert J. H.
steve wrote:is not specifically for "tube distortion" but rather a distortion effect that offers a range of creative possibilities (not just "clipping").
The field is wide for creativity, even with the sparse controls we've defined so far. We can distort the Signal vertically (wave-shaping) and horizontally (pushing/pulling the periods on the time line). Then, there are the classic Hp and LP filters that are always involved. The two sets of modulation (AM and FM) could also be used. But these have the drawback that the *table* is limited.
In many cases, there is also a random fluctuation going on as in analog equipment due to capacitor leckage or simply aging of the components. What I primerly want to achieve is that we can create a common ground, where we can start from. Something like an effect chain that the presets can make a parametric use of. Something like a generalised procedure or consequential modul execution with its preset dependent parameters, like
  • LP/HP/Amplification
  • Wave-shaping
  • LP/HP/Amplification
  • time composition
  • LP/HP/amplification
  • Modulation
  • Lp/HP/Amplification
  • preset's additional nukleus function (e.g. randomization)
  • LP/HP/Amplification
  • Wet/dry mix
The user chooses a preset and the parameter list is given to the main function. In Pseudocode something like:

Code: Select all

(case preset
  (0 (main-modules 
     100 16000 drive #'soft-clipper
     nil nil 0.9 squared-ramp-snd
     nil  nil 1 nil; no modulation
     tone-lp tone-hp  -0.5 #'add-noise
     20 20000 -2 mix))
  (t nil))
Code and list are arbitrary and of no significance, just something to illustrate the concept. The goal is to design the first presets without complicated additional functions, only with numerical parameters or short lambda functions.

Re: Distortion effects

Posted: Sat Nov 10, 2012 7:49 am
by Gale Andrews
steve wrote:
Gale Andrews wrote:OK then that is two votes (including Steve's vote) for a shipped "tube distortion" suitable for voices and guitars.
My vote is not specifically for "tube distortion" but rather a distortion effect that offers a range of creative possibilities (not just "clipping").
Then your vote is "including tube distortion". ;) Other examples of what could be included (with user-facing names)?


Gale

Re: Distortion effects

Posted: Sun Nov 11, 2012 5:26 am
by steve
Gale Andrews wrote:Other examples of what could be included (with user-facing names)?
Some examples:

Overdrive
Fuzz
Tube distortion
Walkie-Talkie
Crunch
Harmonic distortion
Inharmonic distortion
Hard clipping
Soft clipping
Cross-over distortion
Tape saturation

More difficult to program are "modelled" distortion types - those that emulate specific distortion effects such as modelling a specific brand/model of speaker, microphone, amplifier or effect unit.

Re: Distortion effects

Posted: Wed Nov 14, 2012 9:25 am
by Gale Andrews
Thanks. Is "inharmonic distortion" the same as "enharmonic distortion"? I had never heard of the former but it has more search hits than the latter. If they are not the same we need to be clear.



Gale