Stereo Sound Processing

Daniel Zingaro - University of Toronto

In 2010, I presented a nifty assignment that has students write a program to create music from a small notational language. That one works as a second assignment in CS1. Here is another sound-based assignment: this one is an assignment 1, with a focus on processing stereo sound files in interesting ways.

At the University of Toronto, our CS1 course is taught using Python. We use Pygraphics, a locally modified media library derived from Mark Guzdial's Introduction to computing and programming with Python: A Multimedia Approach.

In this assignment, students learn how to remove vocals from music, apply various fades to sound files, and cause sounds to move across the stereo field.

Summary Removing vocals, fading, and panning.
Composing functions, if-statements, and working with sound data.
Early CS1.
Intermediate difficulty.
Students get a kick out of the vocal-removal algorithm. Also, the fade functions give a realistic example of why function composition is useful.
The assignment does not require much code; and the code that it does require can be tricky.
Requires a sounds package that gives access to individual samples of sounds.
Other types of fades (e.g. log, quadratic, cubic) and pans (e.g. right-to-left) are possible.

Assignment Handout


Installation instructions for Pygraphics and its dependencies can be found on the Installing Pygraphics page.

Last modified: 2011-12-29

Extra info about this assignment: