Fade Curves - Quefumas/gensound GitHub Wiki
Here is the reference for all available fade curves, along with their mathematical definitions.
All curves will be described for the case of FadeIn
- just reverse directions for FadeOut
. Expect more curves in the near future.
A neat way to compare two curves would be to apply different curves to both channels of the same stereo Signal (TODO example).
TODO add graphs.
linear
When curve='linear'
, the audio amplitude will rise in a linear manner from complete silence to the audio's full amplitude.
Mathematically, this is achieved by point-wise multiplication of the beginning of the audio with the function x
, as x
rises from 0 to 1 during the fade duration.
polynomial(degree=2)
When curve='polynomial'
, the gradual rise in amplitude is governed by a polynomial, that is, a function of the form x**degree
as x
grows from 0 to 1.
When degree=1
, this is identical to the linear case.
If degree > 1
, this yields a slower start, catching up closer to the end of the fade. For very large values this will make the fade concentrate at the very last moment, which is usually undesirable.
If degree < 1
, the rise in amplitude will be faster than the linear case in the beginning, and slow down gradually.
This curve is the default for CrossFade
, with degree=0.5
, as it supplies 'Equal Power', that is, when matched with a similar fade out curve acting simultaneously, the loudness of both fades stays even throughout. There are also other curves with this property.