Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte noteON = 144; // note on command
- void setup()
- {
- // set "Hairless MIDI" to the same baud rate in the preferences
- Serial.begin(115200);
- }
- void loop()
- {
- for (int i = 60; i < 60+12+12; i++) {
- MIDImessage(noteON, i, 100); // turn note on
- delay(100);
- MIDImessage(noteON, i, 0); // turn note off (note on with velocity 0)
- //delay(100);
- }
- while (1)delay(100);
- }
- 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