SHARE
TWEET

Untitled

a guest Nov 16th, 2012 233 Never
  1. #include <MIDI.h>
  2.  
  3. #define LED 13                  // LED pin on Arduino board
  4.  
  5. void setup() {
  6.   pinMode(LED, OUTPUT);
  7.   pinMode(2,INPUT);
  8.   MIDI.begin(4);                // Launch MIDI with default options
  9.                                 // input channel is set to 4
  10. }
  11.  
  12. void loop() {
  13.   if (digitalRead(2)){
  14.     digitalWrite(LED,HIGH);     // Blink the LED
  15.     MIDI.sendNoteOn(42,127,1);  // Send a Note (pitch 42, velo 127 on channel 1)   // Stop the note
  16.        
  17.   }else{
  18.     digitalWrite(LED,LOW);  
  19.   }
  20. }
RAW Paste Data
Top