another note-off fix.
authorRobin Gareus <robin@gareus.org>
Tue, 15 Sep 2015 15:49:26 +0000 (17:49 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 15 Sep 2015 15:50:27 +0000 (17:50 +0200)
For nearly coincident note-on the sequence does not matter,
but note-off must be sent before a new note-on in strict
order (could be the same note).

libs/evoral/src/Sequence.cpp

index c8a0dd4f23aac62528f35db50635692901e61f52..e153cea9b4ab7c617096c94b2efce645470008ca 100644 (file)
@@ -244,7 +244,7 @@ Sequence<Time>::const_iterator::choose_next(Time earliest_t)
 
        // Use the next note off iff it's earlier or the same time as the note on
        if ((!_active_notes.empty())) {
-               if (_type == NIL || _active_notes.top()->end_time() <= earliest_t) {
+               if (_type == NIL || _active_notes.top()->end_time().to_double() <= earliest_t.to_double()) {
                        _type      = NOTE_OFF;
                        earliest_t = _active_notes.top()->end_time();
                }