Multi Song Setup

Hey all I've seen some people do songs on their Arduino boards with the piezo as a tone generator, so simple melodies like the star wars theme song. I was wondering, is it possible to make these triggerable by a button, and have multiple buttons that trigger different songs? Also, when I tried to do a song with this format http://www.instructables.com/id/How-to-easily-play-music-with-buzzer-on-arduino-Th/ , what came out of the machine was not as intended at all, despite following the steps. Any words of advice? I'm a quite new Arduino user, so I'm not very fluent with the code yet.

jojo1189: what came out of the machine was not as intended at all, despite following the steps. Any words of advice? I'm a quite new Arduino user, so I'm not very fluent with the code yet.

The name "buzzer" stands for two completely different types of tone generators:

  • active piezo buzzer: Just connect to a pin, set to mode OUTPUT and set it HIGH ==> will then play one single tone in its own frequency

  • passive piezo "buzzer": This is a kind of speaker which needs to be driven by a tone frequency ==> will play different frequencies when using the Arduino tone() function

For playing melodies you need a passive piezo buzzer ("piezo speaker").

Which type of buzzer do you have? Did you test it?

I have a passive one, the same one that came with the Starter kit. I've seen the melodies done with one song on the board, which just repeats, but I can't quite figure how to organise in some buttons that will allow me to select a song.

jojo1189: I have a passive one, the same one that came with the Starter kit. I've seen the melodies done with one song on the board

What type of melodies? RTTTL melodies coded in "Ring Tones Text Transfer Language", like the old NOKIA ringtones from the nineties? Such melodies would be easy to handle, and several (older) melody codes can be found in the Internet easily.

jojo1189: which just repeats, but I can't quite figure how to organise in some buttons that will allow me to select a song.

It's just a matter of programming logic. If you have a programming logic that can play one melody of note data, the same programming logic can play different melodies from different note data.

What do you have (seen)?