Home | Lehre | Videos | Texte | Vorträge | Software | Person | Impressum, Datenschutzerklärung | Blog RSS

Audio Processing for Musical Applications

Assignment: In the U.S., radio stations have to beep over offensive words. Write a VST plug-in that detects a beep and replaces it in real time with the content of another .WAV file.

Deadline: 27 January 2006, 6 p.m. (I have to grade the assignments over the following weekend!)

Submit the files via e-mail to jlovisca AT informatik.hs-bremen.de. That mail server is configured somewhat picky to suppress spam. If your mail bounces, use j.loviscach AT computer.org.

In Detail

For testing, create an auxiliary VST plug-in that generates a sine wave of 1 kHz at the maximum undistorted level. Then create the (main) VST plug-in as follows: The input signal is fed into a narrow band pass IIR filter. You determine the envelope of the output of this filter. Whenever this envelope is bellow a given threshold value, you directly feed the input samples to the output. When the envelope increases beyond the threshold, you start playing back a .WAV file instead of the original samples. This (short) .wav is loaded into RAM on startup. If the beep is longer than the .wav file, repeat the .wav file from its beginning.

Deliver a cleaned-up Visual Studio project with no superfluous files or commented code experiements. Take care of freeing memory correctly and ensure that several copies of the plug-ins may run at the same time with no problems. Use modern C++ style: no #define and no global variables if possible, declare items as const or private if possible, etc. Try to write code that's comprehensible to me with a minimum number of code comments, possibly none at all. This concerns for instance using meaningful names for variables and functions. Try to not duplicate code (left/right, process/processReplacing) because that's easy to break. Use subroutines or loops instead.

Write an mini-essay of approximately 300 words about the how the signal processing in your solution works. Don't copy text or images from the Internet. I can use Google, too.

Some optional extensions for bonus points:

If you realize these or other extensions, extend the mini-essay appropriately.

Auxiliary Software

The VST SDK includes project files for a number of platforms, in particular a .sln file for Visual Studio. On top of that, a terse, but helpful documentation is part of the SDK.

The free audio editor Audacity (with the VST Enabler) may be the ideal application to use the plug-ins. However, you may want to use a more lightweight software for testing, such as:

The easiest way to create audio material for testing is to convert MP3 files to .wav files, for instance through Audacity. Another option is to grab audio from CDs, for instance with CDex. A simple library to read and write a huge variety of audio file formats is Libsndfile. To build it, start the Make.bat batch file. Then put the generated libsndfile.dll file into the System32 folder and include the sndfile.h and libsndfile.lib files in your Visual Studio project file.

Interactive Digital Filter Design is nice Web-based solution to create filters. The code that it creates is far from efficient in several respects (Which?), but obviously works. In contrast to that, DSPlay offers a nice display and can apply its filters to waves. However, it generates code that is broken in many respects: Neither the reset of the counters for the ring buffer not the computation with xcoeffs[0] is done right.