Hirotaka Yoneda / beep_sound

Dependents:   kiokuryoku_game escapeFromYou junirobo_sample001 ROBOX_Sample_IRcon ... more

Revision:
7:5f1b0adb25ec
Parent:
6:adb925f93199
Child:
8:26cb94806201
diff -r adb925f93199 -r 5f1b0adb25ec beep_sound.cpp
--- a/beep_sound.cpp	Sat Oct 08 16:01:39 2016 +0000
+++ b/beep_sound.cpp	Sat Oct 08 17:05:44 2016 +0000
@@ -59,10 +59,12 @@
 // thisを引数にしないとコンパイルエラーになるので注意
 void beep_sound::playGakuhu()
 {
-    playing = true;
-    beep_sound::NoteOn(otoQue.front().octave, otoQue.front().note);
-    interruptStop.attach(this, &beep_sound::stop, otoQue.front().time_s);
-    otoQue.pop();
+    //if(playing == false){
+        playing = true;
+        beep_sound::NoteOn(otoQue.front().octave, otoQue.front().note);
+        interruptStop.attach(this, &beep_sound::stop, otoQue.front().time_s);
+        otoQue.pop();
+    //}
 }
 
 void beep_sound::SetFrequency(int octave, int note, bool on_off)
@@ -82,7 +84,7 @@
 }
 void beep_sound::onpu(int octave, int note, float time_s)
 {
-    playing == true;
+    playing = true;
     beep_sound::SetFrequency(octave, note, true);
     interruptStop.attach(this, &beep_sound::stop, time_s);
 }
@@ -208,3 +210,28 @@
     }
     wait(0.1);
 }
+void beep_sound::beep_notif1(int nTimes){
+    for (int i = 0; i < nTimes; i++) {
+        beep_sound::setGakuhu(3,5,0.1);
+        beep_sound::setGakuhu(3,10,0.1);
+        beep_sound::setGakuhu(4,2,0.1);
+    }
+    if(playing == false)beep_sound::playGakuhu();
+}
+void beep_sound::beep_notif2(int nTimes){
+    for (int i = 0; i < nTimes; i++) {
+        beep_sound::setGakuhu(1,2,0.1);
+        beep_sound::setGakuhu(1,9,0.1);
+        beep_sound::setGakuhu(2,2,0.2);
+    }
+    if(playing == false)beep_sound::playGakuhu();
+}
+void beep_sound::beep_potatoKansei(int nTimes){
+    for (int i = 0; i < nTimes; i++) {
+        beep_sound::setGakuhu(1,7,0.25);
+        beep_sound::setGakuhu(1,5,0.25);
+        beep_sound::setGakuhu(1,7,0.25);
+        beep_sound::setKyuhu(0.25);
+    }
+    if(playing == false)beep_sound::playGakuhu();
+}