Simon Says
Simon_Says.ino Simon_Says.ino
Size : 7.242 Kb
Type : ino
Simon_Says_mario.ino Simon_Says_mario.ino
Size : 7.309 Kb
Type : ino
Tone gets unziped and put in C:\Arduino\libraries
Tone.rar Tone.rar
Size : 9.052 Kb
Type : rar

How to convert sheet music into an Arduino Sketch

Here's how I converted the sheet music to tones played through a piezo buzzer or speaker on an Arduino. First, open up the toneMelody sketch under Examples->Digital under the Arduino IDE.

Axel F Sheet Music

Next, find the music you want to play. Keep it simple. You can only play one note at a time.

We need two things to make the sketch play this music: tone frequency and length of time to play the tone.

Note names

I know almost nothing about piano or music notes so I had to use the above note names figure out the type of each note. Here's a gotcha that took me awhile. The scale starts at C so it goes C4 D4 E4 F4 G4 A4 B4 C5 D5... See what happened there? A4/B4 come after C4. That's important.

I put dashes in place of no notes:

D4 - F4 D4 - D4 G4 D4 C4

Above is the the first measure.

Note Lengths

Next I had to figure out how long each note was. Then I translated the note lengths into a value.

D4 - F4 D4 - D4 G4 D4 C4 .5 .5 .75 .25 .25 .25 .5 .5 .5

The decimals should equal 4 if you add them all up. .5 is a fraction of a 4 beat measure so I then converted the decimals into note lengths (8th, 16th, etc):

D4 - F4 D4 - D4 G4 D4 C4 .5 .5 .75 .25 .25 .25 .5 .5 .5 8 8 6 16 16 16 8 8 8

Now combine these two things and write your arrays in your sketch:

int line1[] = { NOTE_D4, 0, NOTE_F4, NOTE_D4, 0, NOTE_D4, NOTE_G4, NOTE_D4, NOTE_C4, NOTE_D4, 0, NOTE_A4, NOTE_D4, 0, NOTE_D4, NOTE_AS4, NOTE_A4, NOTE_F4, NOTE_D4, NOTE_A4, NOTE_D5, NOTE_D4, NOTE_C4, 0, NOTE_C4, NOTE_A3, NOTE_E4, NOTE_D4, 0}; int line1_durations[] = { 8, 8, 6, 16, 16, 16, 8, 8, 8, 8, 8, 6, 16, 16, 16, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 8, 8, 2, 2};

Books
30 arduino projects for the evil genius.pdf 30 arduino projects for the evil genius.pdf
Size : 8439.948 Kb
Type : pdf
Beginning Arduino 2nd Ed.pdf Beginning Arduino 2nd Ed.pdf
Size : 11798.581 Kb
Type : pdf
30arduinoproj2ed-master.zip 30arduinoproj2ed-master.zip
Size : 1876.096 Kb
Type : zip

Make a free website with Yola