Skip to main content

rubberband

rubberband(
@stretching 1
@pitchshift 0
@pitchunit 0
@timeunit 2
@envtimeunit 2
@blocksize 1024
@fftwin 1
@phase 0
@pitchmode 2
@formants 0
@smoothing 0
@stretchmode 0
@detector 0
@transients 2
) -> llll

Generates an audio process operation for applying rubberband pitch-shifting/time-stretching to a buffer.


Arguments

  • @stretching [int/float/llll]: stretching amount, as single number or envelope. (default: 1).
  • @pitchshift [int/float/llll]: pitch shifting amount, as single number or envelope. (default: 0).
  • @pitchunit [int]: unit for @pitchshift. (default: 0).
    • 0: cents
    • 1: MIDI
    • 2: Hertz
    • 3: frequency ratio
  • @timeunit [int]: time unit for @stretching. (default: 2).
    • 0: milliseconds
    • 1: samples
    • 2: duration ratio
    • 3: milliseconds difference
    • 4: samples difference
  • @envtimeunit [int]: time unit for @stretching envelope. (default: 2).
    • 0: milliseconds
    • 1: samples
    • 2: duration ratio
    • 3: milliseconds difference
    • 4: samples difference
  • @blocksize [int]: size for granular processes, such as envelopes, in samples. (default: 1024).
  • @fftwin [int]: FFT window type. (default: 1).
    • 0: short
    • 1: standard
    • 2: long
  • @phase [int]: phase adjustment mode. (default: 0).
    • 0: elastic
    • 1: precise
  • @pitchmode [int]: pitch shift mode. (default: 2).
    • 0: high speed
    • 1: high quality
    • 2: high consistency
  • @formants [int]: formant processing. (default: 0).
    • 0: off
    • 1: on
  • @smoothing [int]: time-domain smoothing. (default: 0).
    • 0: off
    • 1: on
  • @stretchmode [int]: stretch mode. (default: 0).
    • 0: elastic
    • 1: precise
  • @detector [int]: transient detection algorithm. (default: 0).
    • 0: compound
    • 1: percussive
    • 2: soft
  • @transients [int]: transient type. (default: 2).
    • 0: crisp
    • 1: mixed
    • 2: smooth

Output

rubberband operation [llll]


Usage

rubberband is meant to be used with the process function:

$buffer = importaudio('singing.wav'); ## input buffer
$op = rubberband(); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.inspect('after rubberband process')