For my final project, I decided to create a simple, easy to use spatialization pulgin for Chuck using the faust programming language. There were several motivations behind this idea. Firstly, the idea of sound in space has become hugely important to computer music composers. Aside from the usual suspects of pitch, melody, rhythym, etc. location of sound with respect to the listener has become a hugely effective compositional tool. Thus, it would follow that all computer music programs should have some sort of function that makes the movement of sound through space possible. In our dealings with Chuck this quarter, there was no object (at least that I encountered) that made this possible in the manner I would like, something similar to Pure Data's vbap~ object because I loves me some Pd. Therefore, I set out to make my own using the functional programming language Faust (something I really wanted to learn).
In order to do this, my faust code implements a very simple pair-wise panning algorithm for a 4 channel set up (ideally a more generic version could be created where the user can specify the amount of channels but sadly time did not permit). This simply takes any angle in the range 0-360 degrees, and determines which 2 speakers must be used to re-create the sound at that point in the circle of speakers. For example, in a 4-channel speaker set-up which is what this plugin does, if the desired angle of the sound location is at 90 degrees from front center, the program would calculate some amplitudes (which preserve equal power) for the speakers at 45 and 135 degrees. Once this code was written in Faust, it was simply a matter of using the faust2ck software created by CCRMA's own Spencer Salazar to generate a chuggin. This chuggin was then implemented in the Chuck code listed above.
To create an interesting demo for this chuggin, I decided to use Chuck to take input from a Game Trak controller (something from a now defunct golf video game that has been repurposed with great success by many computer musicians) and use that data to calculate angles to send to the chuggin. The Game Trak has two joysticks which both return x and y coordinates. From these I calculate angle values and send those to two implementations of the spatializer chuggin, one for each of the left and right channels of a stereo file. I really liked this implementation because, since the joysticks of the Game Trak extend, you can get some pretty cool hand gestures out of it while moving the sound around. This makes it appear as though you are conducting the sound around the space, almost like turning the spatialization of the sound into it's own instrument which, in some sense, it has become in this modern age of computer music.