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(@stretching 0.5); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after rubberband process')