Synesthesia

An Audio Visualizer With Quicktime And SZG

Abstract | Concept | Organization | Compiling | Running

 

My goal in assembling this application was to find the path of least resistance. I investigated various libraries and open source projects having to do with audio playback and analysis and I came to the conclusion that Apple's Quicktime 7 API was the easiest way to acquire audio and analyze it. I obviously used the Syzygy library as well.

 

The following diagram illustrates how parts of my application interact:

 

Application Diagram

 

As is normally the case, when the program starts, the main() function is automatically run. main() is only a couple of lines long and causes 2 things to happen: the arDistSceneGraph framework object is initialized and the OS X-specific portion of the application is initialized. The OS X portion of the application is driven by interrupts (or event handlers), which means the application does nothing unless it is told to.

 

There are 4 things that cause portions of my code to be executed

Most of these are self-explanatory. What is important to my discussion is the last interrupt--the timer. In the initialize window routine, I instruct the operating system to queue a timer interrupt on a given basis (every 60th of a second, for example). Thus, every 60th of a second, my timer routine is executed, which is where the important stuff happens.

 

The timer routine is very short since all it does is call 2 functions. First, it calls GetMovieAudioFrequencyLevels() which is the Quicktime function to calculate the FFT of the current audio sample. This function places the needed data in a known part of memory. The second function the timer interrupt calls is the arDistSceneGraph updater, which takes the location of the FFT data as its argument (in the form of a pointer).

 

The arDistSceneGraph updater, not surprisingly, updates the graphics database according to the newest FFT results. In standalone mode, the X windows-based simulator renders the graphics to the screen (and also allows the user to navigate the scene by modifying the navigation matrix of the arDistSceneGraph).

 

This is an elegant interface between Quicktime and Syzygy. There are a few obstacles which must be overcome actually make this happen, which I will describe in the next section.

 

<< Concept | Compiling >>

 

 

David Stolarsky . Math 198 . Spring 2006