week9




Links


Code




Today we actually delved into some C++/RTcmix coding, taking an existing RTcmix instrument (PVOC, written by Doug Scott) and modifying it to do evil things to sound. The PVOC instrument does an FFT analysis of an input soundfile and then resynthesizes it in ways specified in the scorefile. The RTcmix documentation is ok, but the main thing to realize is that in the p-fields: 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:

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!