Poliphonic chiptune music player. An arduino, a speaker and you're done! Play the presets or make your own.
- An arduino UNO board
I haven't tested this on other arduino boards, but it is most unlikely to work, say, on a Mega since the program edits directly some registers that have different meanings depending on the board you're using.
- A speaker or an audio jack connector
If you choose to use a speaker, choose a little one, like a piezo speaker, one from old headphones, those you can take apart from toys, etc.
If you want to play the music on your subwoofer, headphones, or other, you can use an audio jack connector, wich is basicly this stuff:
- Some resistors
One 330 Ω resistor for each voice, two 330 Ω resistors for current limiting on the leds and one resistor of at least 1 kΩ for volume limiting. You can use different but similar values of resistors if you want.
- 2 potentiometers
I reccomend 2 10kΩ pots.
- Two leds
Audio jack connector version
============
- Download the project (arduitunes.ino)
- Set things up in your protoboard. If you're using the audio jack connector, please, be sure to turn your speaker's volume and the volume potentiometer all the way down before connecting the arduino to the computer. This is to avoid blowing up your speakers
- Connect your arduino Uno and load the program
- (Gently) Adjust volume and... Enjoy the pokemon battle song theme!
In order to play musical notes, Arduitunes parses strings in real time. These strings must fit some protocol I came up with while programming. Directly writting the music into the program would be a pain in the bottom.
This is why I made an ugly but functional web app wich is a graphical user interface where you can make Arduitune-compatible tunes. This is what I used to create the song you just heard. Check it out! (I'm aware of my lack of web designing skills).
When you're ready editing your song, click "Generar". Go to Arduitunes.ino. In the beggining you'll see three preset tunes: Mario Bros, Pokemon Battle and Shingeki. To select a preset melody simply uncomment the whole thing. Make sure there's only one melody selected, i.e. comment the ones you're not using.
To play your custom made music, comment any uncommented melody, copy the code generated by the web app and paste it somewhere between the
/*##################### PRESET MELODYS ####################*/and the
/*################### END PRESET MELODYS ##################*/Compile, load to the arduino and enjoy.
The webpage's source is also available for editing. Feel free to make it prettier.
=============This was made entirely for fun and for supporting my learning process. Please don't expect much.
Thanks for checking my arduino project!