TimeStretch

TimeStretch (clip, float "tempo", float "rate", float "pitch", int "sequence", int "seekwindow", int "overlap", bool "quickseek", int "aa")

TimeStretch allows changing the sound tempo, pitch and playback rate parameters independently from each other, i.e.:

Parameters:

The speed parameters are percentages, and defaults to 100. If tempo is 200 it will play twice as fast, if it is 50, it will play at half the speed. Adjusting rate is equivalent to using AssumeSampleRate and ResampleAudio.

The time-stretch algorithm has a few parameters that can be tuned to optimize sound quality for certain applications. The current default parameters have been chosen by iterative if-then analysis (read: "trial and error") to obtain the best subjective sound quality in pop/rock music processing, but in applications processing different kind of sound the default parameter set may result in a sub-optimal result.

The time-stretch algorithm default parameter values are

Sequence     82
SeekWindow   28
Overlap      12

These parameters affect the time-stretch algorithm as follows:

The table below summarizes how the parameters can be adjusted for different applications:

Parameter name Default value magnitude Larger value affects... Smaller value affects... Music Speech Effect in CPU burden
Sequence
Default value is relatively large, chosen for slowing down music tempo Larger value is usually better for slowing down tempo. Growing the value decelerates the "echoing" artifact when slowing down the tempo. Smaller value might be better for speeding up tempo. Reducing the value accelerates the "echoing" artifact when slowing down the tempo Default value usually good A smaller value than default might be better Increasing the parameter value reduces computation burden
SeekWindow
Default value is relatively large, chosen for slowing down music tempo Larger value eases finding a good mixing position, but may cause a "drifting" artifact Smaller reduce possibility to find a good mixing position, but reduce the "drifting" artifact. Default value usually good, unless a "drifting" artifact is disturbing. Default value usually good Increasing the parameter value increases computation burden
Overlap
Default value is relatively large, chosen to suit with above parameters.   If you reduce the "sequence ms" setting, you might wish to try a smaller value.     Increasing the parameter value increases computation burden

Notes:

This is NOT a sample exact plugin. If you use it, slight inaccuracies might occur. Since we are dealing with float values rounding errors might occur, especially on large samples. In general however inaccuracies should not exceed a few 10's of milliseconds for movielength samples.

SoundTouch is used in float sample mode.

Examples:

TimeStretch(pitch = 200) 

This will raise the pitch one octave, while preserving the length of the original sample.

TimeStretch(pitch = 100.0*pow(2.0, 1.0/12.0)) 

This will raise the pitch one semi-tone, while preserving the length of the original sample.

TimeStretch(tempo = (100.0*25.0*1001.0)/24000.0)

This will change the tempo from Film speed to PAL speed without changing the pitch.

Credits:

This function uses:

SoundTouch library Copyright (c) Olli Parviainen 2002-2006

http://www.iki.fi/oparviai/soundtouch
http://www.surina.net/soundtouch

Changelog:

v2.55 Initial Release
v2.57 Expose soundtouch parameters

$Date: 2006/04/08 10:43:32 $