Skip to main content

soundtouch

soundtouch(
@stretching 1
@pitchshift 0
@pitchunit 0
@timeunit 2
@antialias 0
@quick 0
@speech 0
) -> llll

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


Arguments

  • @stretching [int/float]: Stretching amount, as a single number. (default: 1).
  • @pitchshift [int/float]: Pitch shifting amount, as single number. (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
  • @antialias [int]: Anti-aliasing filter. (default: 0).
    • 0: Off
    • 1: On
  • @quick [int]: Quick processing. (default: 0).
    • 0: Off
    • 1: On
  • @speech [int]: Tune algorithm for speech. (default: 0).
    • 0: Off
    • 1: On

Output

Soundtouch operation [llll]


Usage

soundtouch is meant to be used with the process function:

$buffer = importaudio('singing.wav'); ## input buffer
$op = soundtouch(@stretching 0.5 @pitchshifting 700); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after soundtouch process')