Johanneszockt1

Untitled

Mar 30th, 2021
23
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data