Skip to content

Commit 45f220a

Browse files
committed
Fix SendSysex
1 parent 3cdd63f commit 45f220a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

OS/MIDI/MIDI.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,31 +102,31 @@ namespace MatrixOS::MIDI
102102
if(includeMeta)
103103
{
104104
uint8_t header[6] = {MIDIv1_SYSEX_START, SYSEX_MFG_ID[0], SYSEX_MFG_ID[1], SYSEX_MFG_ID[2], SYSEX_FAMILY_ID[0], SYSEX_FAMILY_ID[1]};
105-
if(!Send(MidiPacket(EMidiStatus::SysExData, 3, header), port, 5))
105+
if(!Send(MidiPacket(EMidiStatus::SysExData, header[0], header[1], header[2]), port, 5))
106106
{ return false; }
107107

108-
if(!Send(MidiPacket(EMidiStatus::SysExData, 3, header + 3), port, 5))
108+
if(!Send(MidiPacket(EMidiStatus::SysExData, header[3], header[4], header[5]), port, 5))
109109
{ return false; }
110110
}
111111

112112
for (uint8_t index = 0; index < length - 3 - !includeMeta; index += 3)
113113
{
114-
if(!Send(MidiPacket(EMidiStatus::SysExData, 3, data + index), port, 5))
114+
if(!Send(MidiPacket(EMidiStatus::SysExData, data[index], data[index+1], data[index+2]), port, 5))
115115
{ return false; }
116116
}
117117

118118
// Send End
119119
if(includeMeta)
120-
{
120+
{
121121
uint16_t start_ptr = length - length % 3;
122122
uint8_t footer[3] = {0, 0, 0};
123123
for (uint16_t i = start_ptr; i < length; i++)
124124
{
125125
footer[i] = data[start_ptr + i];
126126
}
127127
footer[length % 3] = MIDIv1_SYSEX_END;
128-
129-
if(!Send(MidiPacket(EMidiStatus::SysExEnd, length % 3 + 1, footer), port, 5))
128+
129+
if(!Send(MidiPacket(EMidiStatus::SysExEnd, footer[0], footer[1], footer[2]), port, 5))
130130
{ return false;}
131131
}
132132
else
@@ -138,8 +138,8 @@ namespace MatrixOS::MIDI
138138
{
139139
footer[i] = data[start_ptr + i];
140140
}
141-
142-
if(!Send(MidiPacket(EMidiStatus::SysExEnd, end_frame_length, footer), port, 5))
141+
142+
if(!Send(MidiPacket(EMidiStatus::SysExEnd, footer[0], footer[1], footer[2]), port, 5))
143143
{ return false; }
144144
}
145145
return true;
@@ -166,9 +166,9 @@ namespace MatrixOS::MIDI
166166
#endif
167167

168168
uint8_t reply[] = {
169-
MIDIv1_SYSEX_START, MIDIv1_UNIVERSAL_NON_REALTIME_ID, USYSEX_ALL_CHANNELS, USYSEX_GENERAL_INFO, USYSEX_GI_ID_RESPONSE,
170-
SYSEX_MFG_ID[0], SYSEX_MFG_ID[1], SYSEX_MFG_ID[2],
171-
SYSEX_FAMILY_ID[0], SYSEX_FAMILY_ID[1],
169+
MIDIv1_SYSEX_START, MIDIv1_UNIVERSAL_NON_REALTIME_ID, USYSEX_ALL_CHANNELS, USYSEX_GENERAL_INFO, USYSEX_GI_ID_RESPONSE,
170+
SYSEX_MFG_ID[0], SYSEX_MFG_ID[1], SYSEX_MFG_ID[2],
171+
SYSEX_FAMILY_ID[0], SYSEX_FAMILY_ID[1],
172172
SYSEX_MODEL_ID[0], SYSEX_MODEL_ID[1],
173173
MATRIXOS_MAJOR_VER, MATRIXOS_MINOR_VER, MATRIXOS_PATCH_VER, osReleaseVersion,
174174
MIDIv1_SYSEX_END};

0 commit comments

Comments
 (0)