Commit 3bc07bf3 authored by Pila's avatar Pila

Fixed bug in MIDI library which note duration to be computed as 0 when note ON...

Fixed bug in MIDI library which note duration to be computed as 0 when note ON and note OFF events of same values shared the same time tick
parent 5a400998
Pipeline #1114080 skipped
......@@ -2623,9 +2623,12 @@ MidiFileEvent_t MidiFileNoteStartEvent_getNoteEndEvent(MidiFileEvent_t event)
for (subsequent_event = MidiFileEvent_getNextEventInTrack(event); subsequent_event != NULL; subsequent_event = MidiFileEvent_getNextEventInTrack(subsequent_event))
{
if (MidiFileEvent_isNoteEndEvent(subsequent_event) && (MidiFileNoteEndEvent_getChannel(subsequent_event) == MidiFileNoteStartEvent_getChannel(event)) && (MidiFileNoteEndEvent_getNote(subsequent_event) == MidiFileNoteStartEvent_getNote(event)))
if (MidiFileEvent_isNoteEndEvent(subsequent_event)
&& (MidiFileNoteEndEvent_getChannel(subsequent_event) == MidiFileNoteStartEvent_getChannel(event))
&& (MidiFileNoteEndEvent_getNote(subsequent_event) == MidiFileNoteStartEvent_getNote(event))
&& (MidiFileEvent_getTick(event) != MidiFileEvent_getTick(subsequent_event)))
{
return subsequent_event;
return subsequent_event;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment