Main Content

I have recently become very interested in music. Consequently, I started to learn how to read scores. So, I thought that adapting some songs for Arduino would be a good exercise. I wrote a few Arduino sketches, with some details on mind:

Sketches should be compatible with all or almost all Arduino boards;
No need for installing libraries;
Sketches should be easy to understand and modify.
That said, I have only used the tone() function, which is part of the Arduino “language”. The tone() function is capable of generating a single tone, in only one pin at a time. Libraries such as the Tone library allow you to generate more tones, but use specific timers of some microcontrollers, which causes incompatibility with many boards. This means that the sketches here are monophonic, that is, only one note can be played at a time.

At the moment, the following songs are currently available. Just click the name of the song to view the code.

Cantina Band from Star Wars
Imperial March from Star Wars
Hedwig’s theme from Harry Potter
Star Wars theme
Pulo da gaita from the Brazilian Movie O Auto da Compadecida
Star Trek fanfare
Game of Thrones
The Godfather
Bloody Tears from Castlevania II
Green Hill Zone from Sonic the Hedgehog
Mii channel theme
Professor Layton’s theme from Professor Layton and the Curious Village
Song of stomrs from The Legend of Zelda Ocarina of time
Super Mario Bros’ overworld theme
Tetris theme (Korobeiniki)
Zelda’s Lullaby from The Legend of Zelda Ocarina of time
The Legend of Zelda for the NES
Jigglypuff’s Song from Pokémon
Vampire Killer from Castlevânia
Cannon in D – Pachelbel
Ode to Joy – Beethoven’s Symphony No. 9
Prince Igor – Borodin’s Polovtsian Dances
Minuet in G – Christian Petzold
Brahms’ Lullaby (Wiegenlied)
Fur Elise – Beethoven
Asa Branca – Luiz Gonzaga
Pink Panther Theme
Take on me A-ha
The lick
The Lion sleeps tonight (A-weema-weh)
Take on me
Keyboard cat
Elephant Walk
Happy Birthday
We Wish You a Merry Christmas
Silent Night”

Link to article