-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcontrol_change.go
212 lines (209 loc) · 7.47 KB
/
control_change.go
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package midi
type ControlChangeEvent struct {
Channel int
ID int
Value int
Name string
}
// CCNames is a map of Control Changes
var CCNames = map[uint8]string{
0: "Bank Select",
1: "Modulation Wheel or Lever",
2: "Breath Controller",
3: "Undefined",
4: "Foot Controller",
5: "Portamento Time",
6: "Data Entry MSB",
7: "Channel Volume (formerly Main Volume)",
8: "Balance",
9: "Undefined",
10: "Pan",
11: "Expression Controller",
12: "Effect Control 1",
13: "Effect Control 2",
14: "Undefined",
15: "Undefined",
16: "General Purpose Controller 1",
17: "General Purpose Controller 2",
18: "General Purpose Controller 3",
19: "General Purpose Controller 4",
20: "Undefined",
21: "Undefined",
22: "Undefined",
23: "Undefined",
24: "Undefined",
25: "Undefined",
26: "Undefined",
27: "Undefined",
28: "Undefined",
29: "Undefined",
30: "Undefined",
31: "Undefined",
32: "LSB for Control 0 (Bank Select)",
33: "LSB for Control 1 (Modulation Wheel or Lever)",
34: "LSB for Control 2 (Breath Controller)",
35: "LSB for Control 3 (Undefined)",
36: "LSB for Control 4 (Foot Controller)",
37: "LSB for Control 5 (Portamento Time)",
38: "LSB for Control 6 (Data Entry)",
39: "LSB for Control 7 (Channel Volume, formerly Main Volume)",
40: "LSB for Control 8 (Balance)",
41: "LSB for Control 9 (Undefined)",
42: "LSB for Control 10 (Pan)",
43: "LSB for Control 11 (Expression Controller)",
44: "LSB for Control 12 (Effect control 1)",
45: "LSB for Control 13 (Effect control 2)",
46: "LSB for Control 14 (Undefined)",
47: "LSB for Control 15 (Undefined)",
48: "LSB for Control 16 (General Purpose Controller 1)",
49: "LSB for Control 17 (General Purpose Controller 2)",
50: "LSB for Control 18 (General Purpose Controller 3)",
51: "LSB for Control 19 (General Purpose Controller 4)",
52: "LSB for Control 20 (Undefined)",
53: "LSB for Control 21 (Undefined)",
54: "LSB for Control 22 (Undefined)",
55: "LSB for Control 23 (Undefined)",
56: "LSB for Control 24 (Undefined)",
57: "LSB for Control 25 (Undefined)",
58: "LSB for Control 26 (Undefined)",
59: "LSB for Control 27 (Undefined)",
60: "LSB for Control 28 (Undefined)",
61: "LSB for Control 29 (Undefined)",
62: "LSB for Control 30 (Undefined)",
63: "LSB for Control 31 (Undefined)",
64: "Damper Pedal on/off (Sustain) ≤63 off, ≥64 on",
65: "Portamento On/Off ≤63 off, ≥64 on",
66: "Sostenuto On/Off ≤63 off, ≥64 on",
67: "Soft Pedal On/Off ≤63 off, ≥64 on",
68: "Legato Footswitch ≤63 Normal, ≥64 Legato",
69: "Hold 2 ≤63 off, ≥64 on",
70: "Sound Controller 1 (default: Sound Variation)",
71: "Sound Controller 2 (default: Timbre/Harmonic Intens.)",
72: "Sound Controller 3 (default: Release Time)",
73: "Sound Controller 4 (default: Attack Time)",
74: "Sound Controller 5 (default: Brightness)",
75: "Sound Controller 6 (default: Decay Time)",
76: "Sound Controller 7 (default: Vibrato Rate)",
77: "Sound Controller 8 (default: Vibrato Depth)",
78: "Sound Controller 9 (default: Vibrato Delay)",
79: "Sound Controller 10 (default: undefined)",
80: "General Purpose Controller 5",
81: "General Purpose Controller 6",
82: "General Purpose Controller 7",
83: "General Purpose Controller 8",
84: "Portamento Control",
85: "Undefined",
86: "Undefined",
87: "Undefined",
88: "High Resolution Velocity Prefix",
89: "Undefined",
90: "Undefined",
91: "Effects 1 Depth",
92: "Effects 2 Depth",
93: "Effects 3 Depth",
94: "Effects 4 Depth",
95: "Effects 5 Depth",
96: "Data Increment",
97: "Data Decrement",
98: "Non-Registered Parameter Number (NRPN) - LSB",
99: "Non-Registered Parameter Number (NRPN) - MSB",
100: "Registered Parameter Number (RPN) - LSB*",
101: "Registered Parameter Number (RPN) - MSB*",
102: "Undefined",
103: "Undefined",
104: "Undefined",
105: "Undefined",
106: "Undefined",
107: "Undefined",
108: "Undefined",
109: "Undefined",
110: "Undefined",
111: "Undefined",
112: "Undefined",
113: "Undefined",
114: "Undefined",
115: "Undefined",
116: "Undefined",
117: "Undefined",
118: "Undefined",
119: "Undefined",
120: "[Channel Mode Message] All Sound Off",
121: "[Channel Mode Message] Reset All Controllers",
122: "[Channel Mode Message] Local Control On/Off 0 off, 127 on",
123: "[Channel Mode Message] All Notes Off",
124: "[Channel Mode Message] Omni Mode Off (+ all notes off)",
125: "[Channel Mode Message] Omni Mode On (+ all notes off)",
126: "[Channel Mode Message] Mono Mode On (+ poly off, + all notes off)",
127: "[Channel Mode Message] Poly Mode On (+ mono off, +all notes off)",
}
var CCVals = map[string]int{
"Bank Select": 0,
"Modulation Wheel or Lever": 1,
"Breath Controller": 2,
"Undefined": 3,
"Foot Controller": 4,
"Portamento Time": 5,
"Data Entry MSB": 6,
"Channel Volume": 7,
"Balance": 8,
"Pan": 10,
"Expression Controller": 11,
"Effect Control 1": 12,
"Effect Control 2": 13,
"General Purpose Controller 1": 16,
"General Purpose Controller 2": 17,
"General Purpose Controller 3": 18,
"General Purpose Controller 4": 19,
"Control 0 Bank Select": 32,
"Control 1 Modulation Wheel or Lever": 33,
"Control 2 Breath Controller": 34,
"Control 4 Foot Controller": 36,
"Control 5 Portamento Time": 37,
"Control 6 Data Entry": 38,
"Control 7 Channel Volume": 39,
"Control 8 Balance": 40,
"Control 10 Pan": 42,
"Control 11 Expression Controller": 43,
"Control 12 Effect control 1": 44,
"Control 13 Effect control 2": 45,
"Control 16 General Purpose Controller 1": 48,
"Control 17 General Purpose Controller 2": 49,
"Control 18 General Purpose Controller 3": 50,
"Control 19 General Purpose Controller 4": 51,
"Sustain": 64,
"Portamento": 65,
"Sostenuto": 66,
"Soft Pedal": 66,
"Legato Footswitch": 68,
"Hold 2": 69,
"Sound Variation": 70,
"Timbre/Harmonic Intens.": 71,
"Release Time": 72,
"Attack Time": 73,
"Brightness": 74,
"Decay Time": 75,
"Vibrato Rate": 76,
"Vibrato Depth": 77,
"Vibrato Delay": 78,
"General Purpose Controller 5": 80,
"General Purpose Controller 6": 81,
"General Purpose Controller 7": 82,
"General Purpose Controller 8": 83,
"Portamento Control": 84,
"High Resolution Velocity Prefix": 88,
"Effects 1 Depth": 91,
"Effects 2 Depth": 92,
"Effects 3 Depth": 93,
"Effects 4 Depth": 94,
"Effects 5 Depth": 95,
"Data Increment": 96,
"Data Decrement": 97,
"All Sound Off": 120,
"Reset All Controllers": 121,
"Local Control": 122,
"All Notes Off": 123,
"Omni Mode Off": 124,
"Omni Mode On": 125,
"Mono Mode On": 126,
"Poly Mode On": 127,
}