Skip to main content

mix

mix(
@buffers ## list/llll (required)
@gains null
@offsets null
@resamplingfiltersize 11
@resamplingmode 'sinc'
@resamplingpolicy 3
@ampunit 0
@envampunit 0
@timeunit 0
@envtimeunit 2
@interp 0
@normalize 0
) -> llll

Generates an audio process operation for mixing multiple buffers.


Arguments

  • @buffers [list/llll]: List of buffers to mix. (required)
  • @gains [list/llll/null]: Gain values for each buffer to mix, as either a single number or envelope. (default: null).
  • @offsets [list/null]: Time offset values for each buffer to mix. (default: null).
  • @resamplingfiltersize [int]: Resampling filter size. (default: 11).
  • @resamplingmode [symbol]: Resampling mode. (default: 'sinc').
    • 'sinc'
    • 'nearest neighbor'
    • 'sample and hold'
    • 'linear'
    • 'quad'
    • 'cubic'
  • @resamplingpolicy [int]: Resampling policy. (default: 3).
    • 0: Don't
    • 1: To lowest
    • 2: To highest
    • 3: To most common
    • 4: To max. current
  • @ampunit [int]: Amplitude unit. (default: 0).
    • 0: Linear
    • 1: Decibels
  • @envampunit [int]: Envelope amplitude unit. (default: 0).
    • 0: Linear
    • 1: Decibels
  • @timeunit [int]: Time unit. (default: 0).
    • 0: Milliseconds
    • 1: Samples
    • 2: Duration ratio
    • 3: Milliseconds difference
    • 4: Samples difference
  • @envtimeunit [int]: Envelope time unit. (default: 2).
    • 0: Milliseconds
    • 1: Samples
    • 2: Duration ratio
    • 3: Milliseconds difference
    • 4: Samples difference
  • @interp [int]: Band-limited interpolation via resampling for non-integer offsets. (default: 0).
    • 0: Off
    • 1: On
  • @normalize [int]: Normalization. (default: 0).
    • 0: Never
    • 1: Always
    • 2: Overload protection only

Output

Mix operation [llll]


Usage

mix is meant to be used with the process function:

$buffer = importaudio('singing.wav'); ## input buffer
$op = mix(
@buffers importaudio('guitar.wav') importaudio('drums.wav')
); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after mix process')