Advertisement
Johanneszockt1

Untitled

Mar 30th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. byte noteON = B10010000;
  2. byte noteOFF = B10000000;
  3.  
  4. void setup()
  5. {
  6. // set "Hairless MIDI" to the same baud rate in the preferences
  7. Serial.begin(115200);
  8. }
  9.  
  10. void loop()
  11. {
  12. MIDImessage(noteON, 60, 65);
  13. MIDImessage(noteON, 63, 65);
  14. MIDImessage(noteON, 67, 65);
  15. delay(500);
  16.  
  17. MIDImessage(noteOFF, 60, 0);
  18. MIDImessage(noteON, 61, 65);
  19. delay(500);
  20.  
  21. MIDImessage(noteOFF, 61, 0);
  22. MIDImessage(noteON, 60, 65);
  23. delay(500);
  24.  
  25. MIDImessage(noteOFF, 60, 0);
  26. MIDImessage(noteON, 61, 65);
  27. delay(500);
  28.  
  29. MIDImessage(noteOFF, 61, 0);
  30. MIDImessage(noteON, 60, 65);
  31. MIDImessage(noteOFF, 63, 0);
  32. MIDImessage(noteOFF, 67, 0);
  33. delay(1500);
  34. }
  35.  
  36. void MIDImessage(byte command, byte data1, byte data2)
  37. {
  38. Serial.write(command);
  39. Serial.write(data1);
  40. Serial.write(data2);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement