/* 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 * */p5, p6, p7 and p8 all interact with each other -- it is the ratio of p8 to p7 that determines time-stretching or time-compressing, and the window size and FFT size (p5 and p6) affect how 'grainy' or how 'echoey' the output sounds. The main thing is to experiment around with it. Also be sure to try some of the other FFT-based instruments available. Powerful stuff.
But the main point of the class was to show how you could go in and modify the FFT analysis directly. It's surprisingly easy, because the hard work is already done by the PVOC instrument. The code is rather dense, but in the PVOC::run() (or CLASSPVOC::run() instrument that we developed) member function is the following comment, 'round about line #350 or so:
/* * at this point channel[2*i] contains amplitude data and * channel[2*i+1] contains frequency data (in Hz) for phase * vocoder channels i = 0, 1, ... N/2; the center frequency * associated with each channel is i*f, where f is the * fundamental frequency of analysis R/N; any desired spectral * modifications can be made at this point: pitch modifications * are generally well suited to oscillator bank resynthesis, * while time modifications are generally well (and more * efficiently) suited to overlap-add resynthesis */This means that we have an array, channel[], that is set up with the frequency and amplitude data from the FFT analysis. The even array elements hold the amplitude values for each of the frequencies detected (in the corresponding odd array elements).
The version of the CLASSPVOC instrument available here for
downloading inverts all the frequencies, but you can easily modify
it to do loads of snazzy things. Use your imagination!