Adjustable Fade

Archive of Nyquist Plug-ins.
Many of the plug-ins here will be available on the Audacity Wiki.
Forum rules
This Forum is an archive of old topics concerning Nyquist plug-ins.

Feedback and questions relating to topics may be posted, but please
DO NOT POST NEW TOPICS HERE.

New plug-ins may be posted on the New Plug-Ins board.
Other posts relating to Nyquist should be posted to the main Nyquist board.

The main repository for Audacity/Nyquist Plug-ins is on the Audacity Wiki.
steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Professional sounding fade out.

Post by steve » Wed Oct 24, 2012 3:39 pm

Gale Andrews wrote:
steve wrote:Hopefully we will have room to include a proper "cross fade" effect (that applies a cross-fade) at some point.
This is more difficult because of the plans for a similar effect written in C++.
A built-in effect (C++) has many advantages over a plug-in implementation but a plug-in may be a useful temporary solution while we wait. (We are likely to be waiting years for a built-in version).

Gale Andrews wrote:
steve wrote:Personally I like the "Mid-fade" control, but the interface is greatly simplified by removing it. For "advanced users" I don't think there would be any problem in just adding one "Mid-fade" control, but as you have pointed out that may produce confusion for novice users.
I don't like hidden controls much, but how much work would it be to code it in but leave it commented out?
It's tricky for the Logarithmic and Exponential fade types. They would need to become "normalized", so the default settings will look quite different from v26.
Not hard for the others.

Gale Andrews wrote:(Re: "normalized exponential"...)
If it was an additional "fade type" (so we had 14 types), is it compatible with the "dB Scale" choice?
Yes. We had the "normalized exponential" in v24.

Other than fading from/to silence, the normalized fade with default "Mid-fade" is identical to the current version.
The current version never goes below -145 dB gain.
The "Normalized" version can go to absolute silence, and the amount of "curve" (hence how long the fade remains at a low level) is adjustable.

Gale Andrews wrote:And if we get into commenting out a control, is it possible to comment out a particular fade type cleanly?
It would be possible, but it's not very "clean".

The multiple choice controls present a list of choices.
The returned value is the position of the choice in the list (counting from 0), so for example, if you have 10 items in the menu they are numbered 0 to 9. If you select the 4th item, then the control takes the value "3".

The problem with changing the list is that it will change the numbering of the rest of the list. For example, if there are 10 items and you comment out the 4th item, then items 5 to 10 become items 4 to 9.

Gale Andrews wrote:Before we added the "linear" choice, I had suggested (without liking it very much):

Code: Select all

;control units "Units (dB or % of original level)" choice "dB,Percent" 0
;control max-gain "High Point dB increase or %" real "" 0 0 100
;control min-gain "Low Point dB reduction or %" real "" 100 0 100
The dB values need to be negative for below unity gain.

Gale Andrews wrote:Is there any way for a control to expose different controls (after a reload of the GUI) - "with the control set this way, the commented out controls are treated as uncommented, and (if wanted), the uncommented controls are commented"?
Short answer: No :(

Longer answer: The plug-in header is parsed by Audacity before running the plug-in, so the interface is created before the plug-in code can do anything.

Gale Andrews wrote:Again, not totally the point if the expectation is created that this is "amplitude".
You're suggesting that users will see the values 0 and 1 and think "ah ha, I'll ignore the fact that it says 'Gain', it must mean Amplitude" :?
I even used a single digit "1" rather than "1.0" so that it looks different from the track scale.
Do they also think that "Gas Mark 5" means that the oven will shut down after 5 minutes because that's what their microwave does?
I agree that we should try and make it "not so over-complex that a relative beginner couldn't do a partial fade" but "Gain" is not "Amplitude" and the control clearly says "Gain" and not "Amplitude". I don't see that the numbers 1 and 0 strongly suggest otherwise.

There is also potential for confusion with a % scale. Does "20 %" mean:
a) 20 % lower than the original
b) 20 % of the original (80 % lower)
c) 20 % target level

I don't think that we can completely eliminate all ambiguity - we can try to make clear for the majority of users, but those that still "don't get it" will have to either RTFM, ask on the forum or not use it. We should not be depriving millions of users just because a few that will probably never need the effect may find it too difficult.

Gale Andrews wrote:Of the current three "Gain Values" choices, as a power user, which would be your first, second and third choice to have as default?
I'm not sure that I'm a typical "power user", but much of the time I would find the linear scale most convenient.
I also think that this would be the most convenient for most novice users.
Can you think of a clearer expression than "Gain Values: linear scale"?

If I'm wanting to fade by a specific amount - for example to match the peak level of another track, I would probably use the "Amplify" effect to read the peak levels, so I would then use dB.

Given the choice, I doubt that I would ever use the % scale.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Professional sounding fade out.

Post by steve » Wed Oct 24, 2012 5:06 pm

The question with exponential fades is "what to do close to zero?"

For a mathematically correct curve, a fade out to a very low level is not really useful because much of it is inaudible:
firsttrack000.png
firsttrack000.png (7.03 KiB) Viewed 1971 times
When fading to/from absolute silence, the result would be silence for the entire duration.
firsttrack001.png
firsttrack001.png (6.61 KiB) Viewed 1971 times
One way round the problem is to limit the minimum gain to a small value (-50 dB or less).
The problem then is that it is impossible to to fade to absolute silence.

A "fudge" to work round this second problem is to keep the same "curve shape" below the minimum level and scale that curve down to the user defined level.
An alternative is to limit the minimum gain to a sufficiently low level that it is negligible (say -145 dB).
Another alternative is to fade down to a minimum level, and for user values below that, add a linear fade to the end.


These two fade-outs "look" like useful exponential fade-outs, but neither of them are actually exponential fade-outs:
tracks000.png
tracks000.png (14.49 KiB) Viewed 1971 times
The upper track is an exponential fade out from unity gain to -50 dB (quiet, but certainly not silence and enough to create an audible click at the end).

The second does go to silence, but it is not exponential - it is a linear fade-out that has been applied 4 times. It would be more "curved" if we applied it more than 4 times, less curved if we applied it less than 4 times, and of course linear if we applied it only once.

The upper track can be made to go to silence by offsetting it downward by a tiny amount, but then the initial gain will be slightly less than 1 (unity gain). This loss of gain can be made up by normalizing to unity gain - amplifying the entire fade a little (about +0.0275 dB). This may seem like a tiny amount, but it is enough to create an audible click if it is not normalized.

So to fully define an exponential fade from one level to another, we need to define the initial level, the final level and the upper and lower limits before normalizing.
This will be overly complex for the vast majority of users, so we need to make some assumptions on their behalf.

Should we assume that "the customer is right" and provide a mathematically correct fade?
Should we assume that they want a fade that "looks" like an exponential curve and goes from and to the values that they set?

The latter is probably more useful in most cases, in which case we would need to decide "how curved" we want to make the exponential fade.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

waxcylinder
Forum Staff
Posts: 14685
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Professional sounding fade out.

Post by waxcylinder » Wed Oct 24, 2012 5:11 pm

Gale Andrews wrote:
waxcylinder wrote: It just does not look straightforward or easily comprehensible to me (even though the interface looks simpler now in v26).
Were any of the predecessors more comprehensible (GUI apart)?
Probably not (I have not tested many of them in any detail - mainly looked at the mockups in this thread).

I think I understand "Fade Type" - but I have no idea how to choose between the options :?

I don't understand "Gain Values"

I think I understand "Start (or End) Gain" and vice-versa - but I find this labelling confusing (maybe that means I don't understand) :D

And don't forget that part of my understanding comes from following this thread - if I came to this "blind" I would struggle I think (hence my statement that good and careful documentation will be required.

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Professional sounding fade out.

Post by steve » Wed Oct 24, 2012 5:58 pm

Thanks for your comments waxcylinder.
With 26 versions and countless small variations between versions we must be close to the full set of variations and combinations possible in a Nyquist plug-in of this type. ;)
I think we are getting close and perhaps your "lack of understanding" can help to finally nail down some features so that we can ship this thing.
waxcylinder wrote:I don't understand "Gain Values"
That is probably a good place to start as it is very close to the original feature request that started all this.

If you want to apply a fade out, then it is very quick and simple by using the Audacity "Fade Out" effect. However, sometimes you may want to fade down the audio, but not all the way to silence - you may just want to fade it down to half volume, or fade it up to double the volume. Currently the only way to do this is with the fiddly and not accessible "Envelope Tool".

Terminology:

The standard "Fade Out" effect fades from "Unity Gain" to "Silence".
Unity Gain: Gain = 1, original level, times 1, 100 %, 0 dB amplification.
Silence: Gain = 0, times 0, 0 %, -infinity dB amplification.

So what about 1/2 volume?
Half volume, Gain = 0.5, x 0.5, 50 %, -6 dB

So to fade from one arbitrary amplification level to another, we need to say what these amplification levels are.
So we have 2 controls - one for each end of the fade.

What do we call these controls?
What would you call these controls?
How would you want to set "half volume" or "original level" or "double the original level" or some other arbitrary amount?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Professional sounding fade out.

Post by steve » Wed Oct 24, 2012 6:36 pm

Gale Andrews wrote:Of the current three "Gain Values" choices, as a power user, which would be your first, second and third choice to have as default?
I've been thinking about this.....

If I want to increase the gain by +6 dB, what actually goes on in my head is that I think:
I want it to be twice as big --> double the amplitude = +6 dB.

If I want to reduce the level by -12 dB, what goes on in my head is:
I want it at 1/4 volume --> -6 dB for each halving of the volume --> -12 dB

I'm thinking of "relative amplitude" as "how many times the original" (linear scale), then converting that in my head to dB.


If I'm thinking about "how loud":

"A bit louder" --> that's about +3 dB
"A tiny bit louder --> about +1 dB
"A bit quieter" --> about -3 dB
"Quite a bit quieter" --> about -6 dB
"Much quieter" --> -15 or -20 dB

No conversion - I think of "relative loudness" in dB
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

yulac
Posts: 78
Joined: Mon Oct 08, 2012 6:32 pm
Operating System: Please select

Re: Professional sounding fade out.

Post by yulac » Wed Oct 24, 2012 8:19 pm

Hi I loose password but it is OK now.

Steve I think it is better now but also worse.

It is "boring" without sliders. Who will be encouraged to play around with it?

And I accord, linear is a bad choice. Few beginners shall understand it.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Professional sounding fade out.

Post by steve » Wed Oct 24, 2012 8:49 pm

Thank you for your comments yulac.
yulac wrote:It is "boring" without sliders.
What sliders would you like?
yulac wrote:linear is a bad choice. Few beginners shall understand it.
Do you have any suggestions for a better name?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

yulac
Posts: 78
Joined: Mon Oct 08, 2012 6:32 pm
Operating System: Please select

Re: Professional sounding fade out.

Post by yulac » Thu Oct 25, 2012 3:03 am

steve wrote:Thank you for your comments yulac.
yulac wrote:It is "boring" without sliders.
What sliders would you like?
For the values adjustment, as before.
steve wrote:
yulac wrote:linear is a bad choice. Few beginners shall understand it.
Do you have any suggestions for a better name?
Maybe we do not need the linear. Begiinners shall not unerstand it, or they do, but it is the same as percent (0.5=50) so it is unneeded.
Last edited by yulac on Fri Apr 24, 2015 4:07 pm, edited 2 times in total.
Reason: fixed quote tags

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Professional sounding fade out.

Post by steve » Thu Oct 25, 2012 3:56 am

As it says on Wikipedia (http://en.wikipedia.org/wiki/Gain)
gain is a measure of the ability of a circuit (often an amplifier) to increase the power or amplitude of a signal from the input to the output. It is usually defined as the mean ratio of the signal output of a system to the signal input of the same system. It may also be defined on a logarithmic scale, in terms of the decimal logarithm of the same ratio ("dB gain"). A gain greater than one (zero dB), that is, amplification, is the defining property of an active component or circuit, while a passive circuit will have a gain of less than one.
In other words, the standard way to define gain is as a ratio - what I have called "linear scale", where a value of 1 means unity gain (same out as goes in), a value of 0.5 means half the amplitude, a value of 2 means double the amplitude, a value of 3 means 3 times the amplitude, and so on.

The other common way to define gain is on a dB scale.

Defining gain as a percentage is completely non-standard and I've never come across gain defined as a percentage anywhere in any software, any hardware or any literature. I'm all for innovation but I'm not comfortable about using different terminology to everyone else, especially not as the default.

Perhaps the options would be better as:

Gain as: [Ratio / Percentage / dB gain]
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Professional sounding fade out.

Post by Gale Andrews » Thu Oct 25, 2012 6:57 am

steve wrote:(Re: "normalized exponential"...)
Gale Andrews wrote:If it was an additional "fade type" (so we had 14 types), is it compatible with the "dB Scale" choice?
Yes. We had the "normalized exponential" in v24.[...]
Should we assume that they want a fade that "looks" like an exponential curve and goes from and to the values that they set?

The latter is probably more useful in most cases, in which case we would need to decide "how curved" we want to make the exponential fade.
I would say the curve shape matters more than the silence level. I think we may as well have this as another choice (not worth bringing back the mid-fade slider) .
steve wrote:There is also potential for confusion with a % scale.
I don't think there is much potential for rank beginners who don't know what a gain is, given percentage is common understanding (percentage of something).

Such confusion as there is will be with the "Gain" word when combined with %. I agree that users who think about it a bit more could guess that 20% gain is really 120% or 1.2. In fact, % hardly seems like a "gain" at all, per your comment above, but it's very useful.

The problem with "Linear Scale" as a wording choice (apart from people understanding that 1 is unity) is that it directly invites thinking that e.g. 0.1 is a target that moves the amplitude to 0.1 on the linear scale to left of the waveform.

So, here is one possibility, distinguishing "% of original" from both "gains" (I'm not sure about adding "(1=original)" after "linear", as it may confuse with "% of original":
sshot-5.png
v26a (just rename of units)
sshot-5.png (12.65 KiB) Viewed 1979 times
Would "(1=unity)" be better (I doubt it), or "(1= no change)", or no explanation?

I want to add that I care more about % being there than worrying whether we distinguish % from gain or not - but I think distinguishing it gets over any objections that % is "confusing". "Gain as:" is OK, but perhaps not so clear what it means for the choices other than %.

This still leaves the "Start or End or End or Start" problem. I'm beginning to think a single figure in a box whose width we can't reduce looks odd, and that the End/Start confusion (and having to move into a second box) outweighs any benefit from two boxes being simpler to understand.

So another idea, 26b, which only has a single text box.
sshot-7.png
v26b (v26a and only single text box)
sshot-7.png (11.74 KiB) Viewed 1979 times
Note, I suggest High and Low here, because I think "Start" and "End" in a horizontal set of figures is confusing.

The other thing I am feeling is, what is the advantage in v26, v26a or v26b over the 25f idea: ?
Image

In 25f:
  • the difference between the gain and % choices is clearer
  • those who want sliders won't be offended
  • you can "store" an alternative set of values if you don't mind changing the units
Translated into our current ideas, 25f might like this (v26c):
sshot-4.png
v26c (back to dB sliders and single % box
sshot-4.png (13.58 KiB) Viewed 1979 times

The objections to 26c may be that:
  • we have lost the "linear units" (so it may force dB default which will be worse for beginners)
  • we have the Nyquist interface issue that text in the box disables the sliders (but I think Nyquist users largely accept that)?
If I personally had to decide tonight, I would go with 26c, because it lets us bring the sliders back (nor would I hesitate about making % default, but I know Steve wouldn't agree). Maybe I will change my mind tomorrow.

Does this help? Can we agree the choice is between 26, 26a, 26b or 26c (or close equivalents of them)?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Post Reply