Skip to content

Commit e63c3d0

Browse files
committed
note-off ordering - fixes #6340
Evoral::Beats::operator>() rounds to (1.0 / PPQN), hardcoded 1/1920.0. If the time difference between two events is smaller than 1/PPQN, Beats::operator>() and Beats::operator<() produce ambiguous results. The same pair of values is both "less than" and "greater than" depending which operator is used. While it's fine for some cases to ignore the order of nearly concurent events, the std::priority_queue must be strictly ordered.
1 parent 67aa2f8 commit e63c3d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/evoral/evoral/Sequence.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,21 @@ class LIBEVORAL_API Sequence : virtual public ControlSet {
134134
}
135135
};
136136

137+
#if 0 // NOT USED
137138
struct LaterNoteComparator {
138139
typedef const Note<Time>* value_type;
139140
inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
140141
const boost::shared_ptr< const Note<Time> > b) const {
141142
return a->time() > b->time();
142143
}
143144
};
145+
#endif
144146

145147
struct LaterNoteEndComparator {
146148
typedef const Note<Time>* value_type;
147149
inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
148150
const boost::shared_ptr< const Note<Time> > b) const {
149-
return a->end_time() > b->end_time();
151+
return a->end_time().to_double() > b->end_time().to_double();
150152
}
151153
};
152154

0 commit comments

Comments
 (0)