Advertisement
Guest User

Untitled

a guest
Nov 16th, 2012
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement