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:
1) PVOC with pitchfactor==0 runs inverse FFT mode, which is fairly fast.
That's how the first note runs. All subsequent ones run oscillator-bank
mode, which is SLOW (even on my 2.1 gHz). The gaps are just the
CPU not keeping up. (Haven't you heard gaps using other
CPU-intensive instruments?? They have been the story of my life
until I got my new machine).
2) PVOC uses a pitch factor, not octave pt pitch class (oct.pc). To go up an
octave, you use "2.0". You can use the existing pch...() etc. tools
to generate a factor from OPPC (I think you divide one by another).
3) I think I added code to support reading one channel of a
multi-channel input file. I do not recall a request for letting
it run to stereo out. Just connect its output to STEREO().
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);