temposcal
Phase-locked vocoder processing with onset detection/processing, 'tempo-scaling'.
temposcal implements phase-locked vocoder processing using function tables containing sampled-sound sources, with GEN01, and temposcal will accept deferred allocation tables.
This opcode allows for time and frequency-independent scaling. Time is advanced internally, but controlled by a tempo scaling parameter; when an onset is detected, timescaling is momentarily stopped to avoid smearing of attacks. The quality of the effect is generally improved with phase locking switched on.
temposcal will also scale pitch, independently of frequency, using a transposition factor (k-rate).
temposcal can also preserve the spectral envelope while pitch is shifted, using either a one-pass cepstral estimate or an iterative true-envelope estimate. This is enabled with the optional kkeepform and kcoefs arguments.
Syntax
Initialization
ifftsize -- FFT size (power-of-two), defaults to 2048.
idecim -- decimation, defaults to 4 (meaning hopsize = fftsize/4)
ibeta -- scaling exponent for Laroche–Dolson phase locking, used only when klock is 3. A value of 1 (the default) selects identity phase locking. Scaled locking is applied within the current frame's peak regions; peaks are not matched across frames as in the full Laroche–Dolson scaled algorithm.
The optional arguments are positional, so supplying a later argument requires supplying all earlier ones as well.
Performance
ktimescal -- timescaling ratio, < 1 stretch, > 1 contract.
kamp -- amplitude scaling
kpitch -- grain pitch scaling (1=normal pitch, < 1 lower, > 1 higher; negative, backwards)
klock -- phase-locking mode: 0 disables locking; 1 selects the legacy phase-locking algorithm; 2 selects Laroche–Dolson identity phase locking; 3 selects Laroche–Dolson scaled phase locking. Other non-zero values use the legacy algorithm.
ktab -- source signal function table. Deferred-allocation tables (see GEN01) are accepted, but the opcode expects a mono source. Tables can be switched at k-rate.
konset -- enables onset detection when non-zero (default 1). When disabled, time scaling is applied without pausing at detected onsets.
koffset -- initial read position in seconds (default 0).
kthresh -- threshold based on the dB power spectrum ratio between two successive windows. A detected ratio above it cancels timescaling momentarily to avoid smearing (default 1).
kkeepform -- formant-preservation mode (default 0): 0 disables preservation,
1 uses a liftered cepstral envelope, and 2 uses an iterative true envelope.
Values below 0 are treated as 0 and values above 2 as 2. Preservation is
bypassed when the effective pitch (kpitch, multiplied by any source resampling
ratio) is within a quarter tone of 1.
kcoefs -- number of cepstral coefficients used by modes 1 and 2 (default 80, maximum half the FFT size). This is read at k-rate.
Examples
Here is an example of the temposcal opcode. It uses the file temposcal.csd.
See also
Short-time Fourier Transform (STFT) Resynthesis
Credits
Author: Victor Lazzarini
February 2010
New plugin in version 5.13
February 2005.