This repository was archived by the owner on Oct 26, 2023. It is now read-only.
File tree 3 files changed +9
-9
lines changed
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ class MS3 : public USBH_MIDI {
171
171
/* *
172
172
* Check if we've received any data.
173
173
*/
174
- bool receive (unsigned long ¶meter, byte &dataOut) {
174
+ bool receive (unsigned long ¶meter, int &dataOut) {
175
175
byte
176
176
incoming[MIDI_EVENT_PACKET_SIZE] = {0 },
177
177
data[MIDI_EVENT_PACKET_SIZE] = {0 },
@@ -215,9 +215,9 @@ class MS3 : public USBH_MIDI {
215
215
}
216
216
dataOut = (byte) data[dataLength - 3 ];
217
217
218
- // If the data is one byte longer, add 128 to the return value for a full byte range.
219
- if (dataLength == 16 && data[dataLength - 4 ] == 0x01 ) {
220
- dataOut += 128 ;
218
+ // If the data is one byte longer, add x times 128 to the return value for a full integer range.
219
+ if (dataLength == 16 ) {
220
+ dataOut += data[dataLength - 4 ] * 128 ;
221
221
}
222
222
223
223
return true ;
@@ -280,7 +280,7 @@ class MS3 : public USBH_MIDI {
280
280
* This is the main function for both receiving and sending data when
281
281
* there's nothing to receive.
282
282
*/
283
- byte update (unsigned long ¶meter, byte &data) {
283
+ byte update (unsigned long ¶meter, int &data) {
284
284
285
285
// Are we ready?
286
286
if (MS3::isReady ()) {
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ unsigned long timerStart = 0;
58
58
/* *
59
59
* Incoming data handler.
60
60
*/
61
- void parseData (unsigned long parameter, byte data) {
61
+ void parseData (unsigned long parameter, int data) {
62
62
switch (parameter) {
63
63
64
64
// Refresh all effect states on patch changes.
@@ -206,7 +206,7 @@ void loop() {
206
206
207
207
// The MS-3 library stores the parameter and data in these variables.
208
208
unsigned long parameter = 0 ;
209
- byte data = 0 ;
209
+ int data = 0 ;
210
210
211
211
// Check for incoming data or send a queued item.
212
212
switch (MS3.update (parameter, data)) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const unsigned long P_PATCH = 0x00010000;
20
20
/* *
21
21
* Incoming data handler.
22
22
*/
23
- void parseData (unsigned long parameter, byte data) {
23
+ void parseData (unsigned long parameter, int data) {
24
24
switch (parameter) {
25
25
case P_PATCH:
26
26
Serial.print (F (" Patch number received: " ));
@@ -64,7 +64,7 @@ void loop() {
64
64
65
65
// Check for incoming data or send a queued item.
66
66
unsigned long parameter = 0 ;
67
- byte data = 0 ;
67
+ int data = 0 ;
68
68
switch (MS3.update (parameter, data)) {
69
69
70
70
// Fetch the current active patch on the MS-3.
You can’t perform that action at this time.
0 commit comments