Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of blip_playnotes by
Revision 4:e80a13a4e8eb, committed 2015-11-30
- Comitter:
- paclema
- Date:
- Mon Nov 30 11:10:51 2015 +0000
- Parent:
- 3:a6355b9de221
- Commit message:
- updated playnotes program
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Nov 29 12:43:58 2015 +0000 +++ b/main.cpp Mon Nov 30 11:10:51 2015 +0000 @@ -11,40 +11,23 @@ float note[18]= {1568.0,1396.9,1244.5,1244.5,1396.9,1568.0,1568.0,1568.0,1396.9, 1244.5,1396.9,1568.0,1396.9,1244.5,1174.7,1244.5,1244.5, 0.0 }; -float duration[18]= {0.48,0.24,0.72,0.48,0.24,0.48,0.24,0.24,0.24, - 0.24,0.24,0.24,0.24,0.48,0.24,0.48,0.48, 0.0 +float duration[32]= {0.48,0.24,0.72,0.48,0.24,0.48,0.24,0.24,0.24, + 0.24,0.24,0.24,0.24,0.48,0.24,0.48,0.48, 0.0, + 0.48,0.24,0.72,0.48,0.24,0.48,0.24,0.24,0.24, + 0.24,0.24,0.24 }; //Mario main theme melody -int melody[] = { +float melody[32] = { NOTE_E7, NOTE_E7, 0, NOTE_E7, 0, NOTE_C7, NOTE_E7, 0, NOTE_G7, 0, 0, 0, NOTE_G6, 0, 0, 0, - NOTE_C7, 0, 0, NOTE_G6, - 0, 0, NOTE_E6, 0, - 0, NOTE_A6, 0, NOTE_B6, - 0, NOTE_AS6, NOTE_A6, 0, - - NOTE_G6, NOTE_E7, NOTE_G7, - NOTE_A7, 0, NOTE_F7, NOTE_G7, - 0, NOTE_E7, 0, NOTE_C7, - NOTE_D7, NOTE_B6, 0, 0, - - NOTE_C7, 0, 0, NOTE_G6, - 0, 0, NOTE_E6, 0, - 0, NOTE_A6, 0, NOTE_B6, - 0, NOTE_AS6, NOTE_A6, 0, - - NOTE_G6, NOTE_E7, NOTE_G7, - NOTE_A7, 0, NOTE_F7, NOTE_G7, - 0, NOTE_E7, 0, NOTE_C7, - NOTE_D7, NOTE_B6, 0, 0 }; //Mario main them tempo -int tempo[] = { +float tempo[] = { 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, @@ -79,7 +62,7 @@ // Start song and return once playing starts //mySpeaker.PlaySong(note,duration); - mySpeaker.PlaySong(melody,tempo); + mySpeaker.PlaySong(melody,duration); // loops forever while song continues to play to end using interrupts while(1) {