-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathser_midi.ino
124 lines (102 loc) · 2.41 KB
/
ser_midi.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
void OnConnected1() {
//ledBlink();
blinkOn();
}
void OnDisconnected1() {
//ledBlink();
blinkOff();
}
void handleNoteOn1(byte channel, byte pitch, byte velocity){
#ifdef DEBUG
Serial.print("Note On - CH: ");
Serial.print(channel);
Serial.print(" PITCH: ");
Serial.print(pitch);
Serial.print(" VEL: ");
Serial.print(velocity);
Serial.println();
ledBlink();
#endif
SERMIDI.sendNoteOn(pitch, velocity, channel);
}
void handleNoteOff1(byte channel, byte pitch, byte velocity){
#ifdef DEBUG
Serial.print("Note Off - CH: ");
Serial.print(channel);
Serial.print(" PITCH: ");
Serial.print(pitch);
Serial.print(" VEL: ");
Serial.print(velocity);
Serial.println();
ledBlink();
#endif
SERMIDI.sendNoteOff(pitch, velocity, channel);
}
void handlePitchBend1( byte channel, int pitch){
#ifdef DEBUG
Serial.print("PB - CH: ");
Serial.print(channel);
Serial.print(" PITCH: ");
Serial.print(pitch);
Serial.println();
#endif
SERMIDI.sendPitchBend(pitch, channel);
}
void handleAfterTouchPoly1(byte channel, byte note, byte velocity){
#ifdef DEBUG
Serial.print("AT - CH: ");
Serial.print(channel);
Serial.print(" note: ");
Serial.print(note);
Serial.print(" BYTE2: ");
Serial.print(velocity);
Serial.println();
#endif
SERMIDI.sendAfterTouch(note, velocity, channel);
}
void handleAfterTouchChannel1(byte channel, byte velocity){
#ifdef DEBUG
Serial.print("AT - CH: ");
Serial.print(channel);
Serial.print(" BYTE1: ");
Serial.print(velocity);
Serial.println();
#endif
SERMIDI.sendAfterTouch(velocity, channel);
}
void handleControlChange1(byte channel, byte byte1, byte byte2){
#ifdef DEBUG
Serial.print("CC - CH: ");
Serial.print(channel);
Serial.print(" BYTE1: ");
Serial.print(byte1);
Serial.print(" BYTE2: ");
Serial.print(byte2);
Serial.println();
#endif
SERMIDI.sendControlChange( byte1, byte2, channel);
}
void handleStart1(){
#ifdef DEBUG
Serial.print("Start");
Serial.println();
ledBlink();
#endif
SERMIDI.sendStart();
}
void handleContinue1(){
#ifdef DEBUG
Serial.print("Continue");
Serial.println();
ledBlink();
#endif
SERMIDI.sendStart();
}
void handleStop1(){
#ifdef DEBUG
Serial.print("Stop");
Serial.println();
ledBlink();
#endif
SERMIDI.sendStop();
}