Music Compiler: An Exercise in the Use of Coroutines

Samuel Crow · Cornerstone (Minnesota State University, Mankato) · 2007

Conventional music players typically use either interpreters or streamed sound samples. This project presents an alternative to these by compiling a Protracker music file into a stand-alone binary program. The first goal was to create a program that is smaller than a music file that uses a statically-linked interpreter. A secondary goal was to require less overhead than an interpreter or a streamed audio file. The technique of music playback used here is based on coroutines. One coroutine is used for the main music score and additional coroutines are used to perform time indexed special effects for each of the voices. Both the programming language used to implement this compiler and the language of the programs it generates are ANSIC 1989.

Read the paper · More papers on PaperTik