plays a fucking annoying sound for 10 seconds and loops.

Dependencies:   mbed

Fork of song_demo_PWM by jim hamblen

Files at this revision

API Documentation at this revision

Comitter:
DennisNiehoff
Date:
Thu Oct 29 09:22:41 2015 +0000
Parent:
4:64c31855f0be
Child:
6:ce3c3d9c96e9
Commit message:
Including death sounds (might not be working yet). mBed L0rd 101.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
tones.h Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Oct 28 14:47:31 2015 +0000
+++ b/main.cpp	Thu Oct 29 09:22:41 2015 +0000
@@ -65,7 +65,7 @@
             playbuzz = true;
             buzz();
         }
-        if(songTimer.read() > 9.2)
+        if(songTimer.read() > 29.2)
         {
             songTimer.reset();
             mySpeaker.PlaySong(note,duration);
--- a/tones.h	Wed Oct 28 14:47:31 2015 +0000
+++ b/tones.h	Thu Oct 29 09:22:41 2015 +0000
@@ -115,7 +115,25 @@
   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_D7, NOTE_B6, 0, 0,
+  
+  NOTE_G7, NOTE_FS7, NOTE_F7, NOTE_DS7, 
+  0.0, NOTE_E7, 0.0, NOTE_GS6, 
+  NOTE_A6, NOTE_C7, 0.0, 
+  NOTE_A6, NOTE_C7, NOTE_D7,
+
+  NOTE_G7, NOTE_FS7, NOTE_F7, NOTE_DS7, 
+  0.0, NOTE_E7, 0.0, NOTE_C8, 
+  0.0, NOTE_C8, NOTE_C8, 0.0,
+
+  NOTE_G7, NOTE_FS7, NOTE_F7, NOTE_DS7, 
+  0.0, NOTE_E7, 0.0, NOTE_GS6, 
+  NOTE_A6, NOTE_C7, 0.0, 
+  NOTE_A6, NOTE_C7, NOTE_D7,
+
+  NOTE_DS7, 0.0, 0.0, NOTE_D7,
+  NOTE_C7, 0.0, 
+  
 };
 //Mario main them tempo
 float duration[] = {
@@ -146,21 +164,39 @@
   0.12,0.12,0.12,0.12,
   0.12,0.12,0.12,0.12,
   0.12,0.12,0.12,0.12,
+  
+  
+  0.12,0.12,0.12,0.12,
+  0.12,0.12,0.12,0.12,
+  0.12,0.12,0.12,
+  0.12,0.12,0.12,
+
+  0.12,0.12,0.12,0.12,
+  0.12,0.12,0.12,0.12,
+  0.12,0.12,0.12,0.12,
+
+  0.12,0.12,0.12,0.12,
+  0.12,0.12,0.12,0.12,
+  0.12,0.12,0.12,
+  0.12,0.12,0.12,
+
+  0.12,0.12,0.12,0.12,
+  0.12,0.12,
 };
 
-/*
-
-float note[] =
-{
-    NOTE_E6, NOTE_E6, NOTE_E6, NOTE_C6, NOTE_E6, NOTE_G6, rest,
-    NOTE_C6, NOTE_G5, rest, NOTE_E5, NOTE_A6, NOTE_B6, NOTE_A6, NOTE_A6,
-    NOTE_G5, NOTE_E6, NOTE_G6, NOTE_A6, NOTE_F6, NOTE_G6, NOTE_E6, NOTE_C6, NOTE_D6, NOTE_B5
+//failure sound and failure durations
+float note_death[] = {
+  NOTE_C7, NOTE_CS7, NOTE_D7, 0.0,
+  NOTE_C7, NOTE_G7, 0.0, NOTE_G7,
+  NOTE_G7, NOTE_F7, NOTE_E7,
+  NOTE_C7, NOTE_E6, 0.0, 
+  NOTE_E6, NOTE_C6, 0.0,
 };
-
-float duration[] = 
-{
-    notet, notet, notet, notet, notet, notet, notet,
-    notet, notet, notet, notet, notet, notet, notet, notet,
-    notet, notet, notet, notet, notet, notet, notet, notet, notet, notet
-};
-*/
\ No newline at end of file
+    
+    float duration_death[] = {
+    0.15, 0.15, 0.15, 0.12,
+    0.12, 0.12, 0.12, 0.12,
+    0.09, 0.09, 0.09,
+    0.12, 0.12, 0.12, 
+    0.12, 0.12, 0.12,
+};
\ No newline at end of file