Shai COPY OUR MIDI!!!

Dependencies:   USBDevice mbed

Fork of USBMIDI_HelloWorld by Samuel Mokrani

Revision:
8:c766b9842ae4
Parent:
3:7990c80e953c
--- a/main.cpp	Fri Mar 01 13:25:02 2013 +0000
+++ b/main.cpp	Mon Apr 18 08:39:47 2016 +0000
@@ -2,16 +2,19 @@
 
 #include "mbed.h"
 #include "USBMIDI.h"
+USBMIDI midi;
+float frequency[]={659,554,659,554,440,494,554,587,494,659,554,440}; //frequency array 
+float beat[]=     {1,1,1,1,1,0.5,0.5,1,1,1,1,2};              //beat array
+int   midiarr[] =    {76,73,76,73,69,71,73,74,71,76,73,69};
 
-USBMIDI midi;
 
 int main() {             
     while (1) {    
-        for(int i=48; i<83; i++) {     // send some messages!
-            midi.write(MIDIMessage::NoteOn(i));
-            wait(0.25);
-            midi.write(MIDIMessage::NoteOff(i));
-            wait(0.5);
+        for(int i=0; i<12; i++) { 
+            midi.write(MIDIMessage::NoteOn(midiarr[i]));
+            wait(0.25*beat[i]);
+            midi.write(MIDIMessage::NoteOff(midiarr[i]));
+            wait(0.05);
         }
     }
 }