Thanassis Tsiodras Made a Monkey Island Music Player

This standalone music player emits Monkey Island songs from a PC speaker flawlessly!

Cabe Atwell
3 years agoMusic / Sensors

Thanassis Tsiodras created a Monkey Island PC speaker music player for those who love retro gaming and can’t get enough of the music. He started by modifying the DOSBox to extract the frequency/delay value pairs of the Monkey Island songs. Then, he used Huffman compression to upload the music into ATtiny85, which has 512kB of RAM and 8kB of flash. A speaker integrated onto a circuit board then plays the music.

First, he found the PC speaker’s frequency-driving code, modified the DOSBox’s timer-handling code, and enabled DOSBox to output the frequency that’s being transmitted through the PC-Screamer. After extracting the datasheet music, he used Python to convert it into a .wav file and separated each note into individual songs. This standalone speaker also contains an 8.5KB microcontroller. To fit the songs onto a tiny amount of space, Tsiodras used Huffman coding to compress the data. But first, that data needed to be decoded via C/C++ for real-time reproduction in the microcontroller. It relies on modified Python code to implement Huffman coding as well. However, the corresponding Huffman tables did not fit onto the microcontroller, so he freed up space until it fit. Then, he decoded the data from the Python-generated C-arrays and ensured they matched with the original song data.

Tsiodras employed a transistor amplifier to avoid drawing current directly from the microcontroller. Direct driving could damage the MCU, over time. To drive the transistor’s base at the song’s frequencies, Tsiodras uses a state machine to toggle the single GPIO pin. The pin is also toggled ON/OFF to emit the desired frequency. This project also uses a button to switch from one song to the next.

Next, he switched to the ATtiny85 Makefile and invoked make && make upload. Afterward, he programmed the ATtiny85 with an Arduino Uno, created a board to plug into it, and uploaded the code. This entire process resulted in the music playing flawlessly.

Truly, a labor of love. Thanks for this amazing creation, Tsiodras!

Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles