Skip to main content

fade

fade(
@fadein 5
@fadeout 5
@fadeintype 0
@fadeouttype 0
@fadeincurve -0.25
@fadeoutcurve 0.25
@timeunit 0
) -> llll

Generates an audio process operation for applying fade-in/out to a buffer.


Arguments

  • @fadein [int/float]: Fade-in duration. (default: 5).
  • @fadeout [int/float]: Fade-out duration. (default: 5).
  • @fadeintype [int]: Fade-in type. (default: 0).
    • 0: Linear
    • 1: Sine
    • 2: Curve
    • 3: S-curve
  • @fadeouttype [int]: Fade-out type. (default: 0).
    • 0: Linear
    • 1: Sine
    • 2: Curve
    • 3: S-curve
  • @fadeincurve [int/float]: Fade-in curve amount, between -1 and 1. (default: -0.25).
  • @fadeoutcurve [int/float]: Fade-out curve amount, between -1 and 1. (default: 0.25).
  • @timeunit [int]: Time unit for @start and @end. (default: 0).
    • 0: Milliseconds
    • 1: Samples
    • 2: Duration ratio
    • 3: Milliseconds difference
    • 4: Samples difference

Output

Fade operation [llll]


Usage

fade is meant to be used with the process function:

$buffer = importaudio('singing.wav'); ## input buffer
$op = fade(@fadein 2000 @fadeout 2000); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after fade process')