You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
so, I'm working on a fork of this lib & rtmidi (https://github.com/jcelerier/RtMidi17), but I found a bug when parsing midi files with running status so it may be of interest for you :
1 is a note on, channel 10, note 35, velocity 80
2 is a note on, channel 10, note 49, velocity 80
3 is a note on, channel 10, note 35, velocity 0 which starts a bit later
now, after parsing the first note:
parseEvent is called with dataStart pointing on the second byte of 2 (0x31) since it's the first bit of the midi channel event
type = *dataStart++, hence dataStart points on the third byte of 2 (0x50) and type == 0x31
we enter the running status check :
if (((uint8_t) type & 0x80) == 0)
{
event->m->data[0] = (uint8_t) type;
type = lastEventTypeByte;
}
after this, the data stored in the event looks like :
[31, 00, 00]
-> the type is wrong, and event->m->data[1] is never set !
Instead, it should be :
if (((uint8_t) type & 0x80) == 0)
{
event->m->data[0] = (uint8_t) lastEventTypeByte;
event->m->data[1] = (uint8_t) type;
type = lastEventTypeByte;
}
after which the data looks like
[99, 31, 00]
and the switch can work correctly afterwards
The text was updated successfully, but these errors were encountered:
Hello,
so, I'm working on a fork of this lib & rtmidi (https://github.com/jcelerier/RtMidi17), but I found a bug when parsing midi files with running status so it may be of interest for you :
here: https://github.com/ddiakopoulos/ModernMIDI/blob/master/src/midi_file_reader.cpp#L160
say that you have for instance the following midi bytes sequence:
1 is a note on, channel 10, note 35, velocity 80
2 is a note on, channel 10, note 49, velocity 80
3 is a note on, channel 10, note 35, velocity 0 which starts a bit later
now, after parsing the first note:
dataStart
pointing on the second byte of 2 (0x31) since it's the first bit of the midi channel eventafter this, the data stored in the event looks like :
-> the type is wrong, and
event->m->data[1]
is never set !Instead, it should be :
after which the data looks like
and the switch can work correctly afterwards
The text was updated successfully, but these errors were encountered: