|
Parallel Reverb Processor Carl Doersch and Keith Bare |
|||||||||
|
Proposal Milestone 1 Milestone 2 Final Report Samples Parallel Freeverb Code |
Milestone 1 April 3, 2008 Major Changes: Parallel MIDI synthesis turned out to be too ambitious. We discussed some algorithms which could theoretically be used to parallelize the synthesis process, but these would have been very difficult to code in practice. The problem is that the MIDI file format is very flexible, and, as a result, fully featured programs for working with MIDI files tend to be quite complex. Notes can arrive on any one of many channels, and each channel is handled separately. Drums are handled differently than pitched instruments. The actual computation of samples is interspersed in the code for decoding the MIDI file and handling note events. Furthermore, it is difficult to guess what part of the computation will take the most time; for example, we found files where the majority of the computation was done to perform reverb, which is performed after sythesis produces output samples. Our exploration of MIDI synthesis led us to another interesting computer music based project idea. We found that reverb processing, which is commonly used to enhance studio recorded sounds, is computationally intensive like MIDI synthesis, and hence is an interesting task for a parallel algorithm. Hence, we decided to focus on only reverb processing. Reverb processing begins with an array of input samples, which can be read directly from a .wav file using library functions. These samples are then filtered with comb and all-pass filters; each filter operation is a linear time operation. The output sounds as if the original sound "persists" or echoes, as if the sound had been played in a large room or cave. Accomplished so far: We have decided that our project will be based on the Freeverb3 project. Freeverb3 is designed to be a plugin for a media player, to add reverb effects to whatever sound the media player is producing. We have also designed a small frontend for Freeverb3. We can feed the frontend a .wav file from the command line, and the frontend will feed the samples from the .wav file into Freeverb3 and send the output from Freeverb3 to another .wav file. Other than that, our actual changes to Freeverb3 have been minor (notably removing one large overhead--that Freeverb3 was doing interpolation to convert 44100 hz audio into 44100 hz audio; the same effect can be accomplished with memcpy). We have also done some profiling to determine where the bulk of the work is done. We have briefly considered a few different approaches to parallelizing the algorithm. First, each filter can likely be implemented in its own thread. Second, it may be possible to have a thread process only a small portion of the input buffer. For example, in an 8-second audio file, with 8 threads, each thread could process one second of sound. To tie together each piece, each thread would need to go slightly beyond the end of its second, until the output from the next thread looks similar enough its own output. Meeting The Milestone: Since the scope of our project has changed (fairly recently), we have only accomplished some of the goals of this milestone. We have decided to use Freeverb3. We have a very basic idea of how Freeverb3 works, and we have vague notions of how to parallelize it. Surprises: The biggest surprise was the complexity of the code needed to parse a MIDI file and the number of steps involved in the process. To deal with this, we changed the scope of our project to focus on a small part of the synthesis process. Revised Schedule: Although we've had some setbacks in starting, we still hope to have a working version of parallel code by the next milestone.
Resources Needed: The project may use either MPI or OpenMP, depending on the final algorithm we use. Then there's two tasks: simply synthesizing files to produce file output, and then synthesizing files in real time. When doing file output, in the MPI case we will most likely use BigBen and in the OpenMP case we will most likely use Cobalt. But to render files in real time, we may need to use a different system, perhaps a 4 or 8 core workstation that actually has a sound card. |
||||||||