the all thing is working !
This commit is contained in:
34
midi/midi.ino
Normal file
34
midi/midi.ino
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "MIDIUSB.h"
|
||||
#define NUM_BUTTONS 7
|
||||
|
||||
// https://github.com/arduino/tutorials/blob/master/ArduinoZeroMidi/PitchToNote.h
|
||||
|
||||
|
||||
uint8_t intensity = 127;
|
||||
void setup(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
void loop(){
|
||||
noteOn(0, 95, intensity);
|
||||
MidiUSB.flush();
|
||||
delay(1000);
|
||||
noteOff(0, 95, 0);
|
||||
MidiUSB.flush();
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void noteOn(byte channel, byte pitch, byte velocity) {
|
||||
|
||||
midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity};
|
||||
|
||||
MidiUSB.sendMIDI(noteOn);
|
||||
}
|
||||
|
||||
void noteOff(byte channel, byte pitch, byte velocity) {
|
||||
|
||||
midiEventPacket_t noteOff = {0x08, 0x80 | channel, pitch, velocity};
|
||||
|
||||
MidiUSB.sendMIDI(noteOff);
|
||||
}
|
Reference in New Issue
Block a user