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(); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.inspect('after soundtouch process')