PVOC


phase vocoding: A analysis/resynthesis technique whereby a sound is anylized through a filter bank with additional computation of phase deviation from each of the channels of the vocoder (sort of an expanded Fourier transform). The data discerned from the analysis allows for realistic time-independent transposition and, by corollary, pitch-independent time-stretching of a soundfile, with much fewer resynthesis artifacts than would normally be possible (from Dodge and Jerse, 1997).

The RTcmix PVOC instrument uses a standard FFT analysis with additional phase computation, allowing the user to specify FFT parameters and time- and pitch-shifting in terms of multiples of the original sound.

Syntax:


PVOC(outskip, inskip, dur, amp, input_chan, fft_size, window_size, decim, interp, [ pitch_mult, npoles, osc threshold ])

In comment form:
/* PVOC: phase vocoder instrument
*
*  p0 = outskip
*  p1 = inskip
*  p2 = dur
*  p3 = amp
*  p4 = input channel
*  p5 = fft size
*  p6 = window size
*  p7 = decimation amount (readin)
*  p8 = interpolation amount (putout)
*  p9 = pitch multiplier
*  p10 = npoles
*
*/

Additional info from Doug Scott:

Here is a sample scorefile:
rtsetparams(44100, 1, 512);
rtinput("/home/dscott/sounds/fine4.wav");

PVOC(start=0,inputskip=0,inputread=DUR(0),amp=1,inputchan=0,fft=1024,window=2*fft,readin=1024,putout=2*readin,pmult=0,npoles=0)
And another:
rtsetparams(44100, 1, 512);
rtinput("/home/dscott/sounds/fine4.wav");
PVOC(0, 0, DUR(0), 1, 0, 1024, 2048, 100, 100, 0.9)
And one more just for fun:
rtsetparams(44100, 1, 512);
rtinput("/home/dscott/sounds/fine4.wav");

/* PVOC(start, inskip, indur, amp, inchan, */
/*     fftsize, windowsize, decim, interp, pitch, nLpcoeffs, synthThresh); */

start = 0;
inskip = 0;
duration = DUR(0);
gain = 1;
inskip = 0;
fftsize = 2048;
winsize = 2048*2;
pitch = 1;
decim = 512;
interp = 512;
nLPCoeffs = 0;
thresh = 0;

PVOC(start, inskip, duration, gain, 0, fftsize, winsize, decim, interp, pitch, nLPCoeffs, thresh);

start = start + duration;
pitch = pitch * 0.8;
PVOC(start, inskip, duration, gain, 0, fftsize, winsize, decim, interp, pitch, nLPCoeffs, thresh);

start = start + duration;
pitch = pitch * 0.8;
PVOC(start, inskip, duration, gain, 0, fftsize, winsize, decim, interp, pitch, nLPCoeffs, thresh);

start = start + duration;
pitch = pitch * 0.8;
PVOC(start, inskip, duration, gain, 0, fftsize, winsize, decim, interp, pitch, nLPCoeffs, thresh);