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 fadein/fadeout 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.inspect('after fade process')