Advertisement
Johanneszockt1

Untitled

Mar 30th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. byte noteON = 144; // note on command
  2.  
  3. void setup()
  4. {
  5. // set "Hairless MIDI" to the same baud rate in the preferences
  6. Serial.begin(115200);
  7. }
  8.  
  9. void loop()
  10. {
  11. for (int i = 60; i < 60+12+12; i++) {
  12.  
  13. MIDImessage(noteON, i, 100); // turn note on
  14. delay(100);
  15. MIDImessage(noteON, i, 0); // turn note off (note on with velocity 0)
  16. //delay(100);
  17. }
  18. while (1)delay(100);
  19. }
  20.  
  21. void MIDImessage(byte command, byte data1, byte data2)
  22. {
  23. Serial.write(command);
  24. Serial.write(data1);
  25. Serial.write(data2);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement