Muscily Hopeless... some help with a piezo/song.

Hey there, I've decided I'd like to try and do a music box build for my fiance with "our song" trouble is... I fail at all things music related...

I've used a piezo in a project before for just alarm sounds ect but I don't know sheet music or anything like that... so I was curious if someone could help me out.

Using the first example here: PlayMelody I've got the bare bones of how to control it... but am at a loss at how to transpose sheet music/tabs to this :(

The song is Everything by Lifehouse, and I found this piano tutorial on Youtube that seems like it would be the best way to go about it.. but like I said #fail.

So I just want a very short portion of this song to play (Which from what I can tell almost all of it are the same chords); Starting at 3:29 on the start of that verse "And how can I stand here with you" and ending at 6:06 (But I want to cut out like 1/2 of that because the chorus is just repeated over and over, so I'm going to only play that section like, 2x and then go to the outro)

Hoping someone can help me out, thanks!

fail... forgot YouTube link...

YouTube Video

but am at a loss at how to transpose sheet music/tabs to this :frowning:

… (Which from what I can tell almost all of it are the same chords);

The Arduino can’t play chords. It only plays one note at a time. Maybe, that’s the confusion?

The note/pitch you perceive is the “root” of the chord and that’s (almost always) the lowest note in the chord. That’s the note you’d sing or the note you’d play on an instrument that can’t play chords.

but I don’t know sheet music or anything like that

You don’t have to “sight read” music in real-time. You just have to “decode” the note & duration (quarter-note, half-note, or whole-note), one note at a time.

RDaugherty:

fail... forgot YouTube link...

YouTube Video

fail. "This video is not available"

PaulRB:

fail. "This video is not available"

Weird, works fine for me.

Youtube video visibility may vary regionally.

The Arduino can't play chords. It only plays one note at a time. Maybe, that's the confusion?

Well actually it can but not using the tone library. Their are two techniques to playing chords. One is to play each note through a different pin and then mix each pin output together with resistors and capacitors.

The other is to generate the waveform as a signal and then play it out through a PWM pin, with the PWM frequency set to something outside the audio range.

This is not standard stuff but can be done. Their are a few libraries on line to do this, or for more actual understanding of what it involves, along with code their is my book. http://www.apress.com/gb/book/9781484217207

As to generating a list of notes from a music stave you just need to write down a list of notes and the time. This is a lot more simple than you think. Each position on a stave is a separate note that follows one after the other, just find the key by googling "music stave" then each shape of not represents the length of note in a binary progression. That means you start at the full note and each shape change is half the length of the previous one.