Shai COPY OUR MIDI!!!

Dependencies:   USBDevice mbed

Fork of USBMIDI_HelloWorld by Samuel Mokrani

Revision:
2:4505f7d7196e
Parent:
1:4108aa07d2a7
Child:
3:7990c80e953c
--- a/main.cpp	Fri Nov 04 11:52:45 2011 +0000
+++ b/main.cpp	Fri Nov 04 11:58:57 2011 +0000
@@ -5,28 +5,13 @@
 
 USBMIDI midi;
 
-//Bus of buttons
-BusInOut buttons(p21, p22, p23, p24, p25, p26, p29);
-
-int main() {
-    uint8_t p_bus = 0;
-    uint8_t bus = 0;
-    uint8_t add;
-    while (1) {
-        //if buttons state changes, send a MIDI message
-        bus = buttons.read();
-        if (bus != p_bus) {
-            p_bus = bus;
-            if (p_bus) {
-                for (int i = 0; i < 7; i++) {
-                    add = (p_bus & (1 << i)) ? (i + 1) : 0;
-                    if (add) {
-                        midi.write(MIDIMessage::NoteOn(48 + add));
-                        midi.write(MIDIMessage::NoteOff(48 + add));
-                    }
-                }
-            }
+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);
         }
-        wait(0.001);
     }
 }