Arduino boards aren’t exactly well equipped for playing audio, with it’s measly amount of memory, clock speed and bit depth; However, Enrico Colombini has managed to make a wonderful 8-bit music player out of nothing more than an Arduino Uno and some resistors and capacitors.
Enrico has create a project that allows 6 different 8-bit voices to be played (1 from each of the 6 PWM pins), and each voice has a choice of 16 different instruments and an ADSR envelope. As PWM is not really suitable for direct audio output, he has created a filter (using nothing more than some caps and resistors), which creates an analog audio signal to feed into an amplifier and speakers.
The music that is uploaded is created using a custom program. You feed in the note data as a text file, and the program spits out some machine code. You can upload this to the Arduino’s flash memory, or upload on the fly over serial. If you’re used to creating music in a DAW, you might be surprised to learn that it doesn’t use MIDI data. Compared to Enrico’s solution, MIDI has a relatively large file size, and would require more storage space to store, and more CPU cycles to decrypt; however this implementation is pretty easy to grasp.
The results are strangely beautiful – a lovely, warm 8-bit sound that brings around nostalgia from the days of old. It’s sounds exactly like the toys and games of yesteryear, and it’s amazing to think it came out of an Arduino!
The whole project, including schematics, music compiler, uploader and instrument designer is open-sourced, and you can read more about it at the Play-V6 page.