- if (ev.time() < _last_ev_time_beats) {
- warning << string_compose(_("Skipping event with unordered time %1"), ev.time())
- << endmsg;
- return;
+ Temporal::Beats time = ev.time();
+ if (time < _last_ev_time_beats) {
+ const Temporal::Beats difference = _last_ev_time_beats - time;
+ if (difference.to_double() / (double)ppqn() < 1.0) {
+ /* Close enough. This problem occurs because Sequence is not
+ actually ordered due to fuzzy time comparison. I'm pretty sure
+ this is inherently a bad idea which causes problems all over the
+ place, but tolerate it here for now anyway. */
+ time = _last_ev_time_beats;
+ } else {
+ /* Out of order by more than a tick. */
+ warning << string_compose(_("Skipping event with unordered beat time %1 < %2 (off by %3 beats, %4 ticks)"),
+ ev.time(), _last_ev_time_beats, difference, difference.to_double() / (double)ppqn())
+ << endmsg;
+ return;
+ }