yanay nevela
/
lab5_part4_24
Shai COPY OUR MIDI!!!
Fork of USBMIDI_HelloWorld by
main.cpp
- Committer:
- yanay_amir
- Date:
- 2016-04-18
- Revision:
- 8:c766b9842ae4
- Parent:
- 3:7990c80e953c
File content as of revision 8:c766b9842ae4:
// Hello World example for the USBMIDI library #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}; int main() { while (1) { 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); } } }