Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte noteON = B10010000;
- byte noteOFF = B10000000;
- void setup()
- {
- // set "Hairless MIDI" to the same baud rate in the preferences
- Serial.begin(115200);
- }
- void loop()
- {
- MIDImessage(noteON, 60, 65);
- MIDImessage(noteON, 63, 65);
- MIDImessage(noteON, 67, 65);
- delay(500);
- MIDImessage(noteOFF, 60, 0);
- MIDImessage(noteON, 61, 65);
- delay(500);
- MIDImessage(noteOFF, 61, 0);
- MIDImessage(noteON, 60, 65);
- delay(500);
- MIDImessage(noteOFF, 60, 0);
- MIDImessage(noteON, 61, 65);
- delay(500);
- MIDImessage(noteOFF, 61, 0);
- MIDImessage(noteON, 60, 65);
- MIDImessage(noteOFF, 63, 0);
- MIDImessage(noteOFF, 67, 0);
- delay(1500);
- }
- void MIDImessage(byte command, byte data1, byte data2)
- {
- Serial.write(command);
- Serial.write(data1);
- Serial.write(data2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement