Skip to content

Commit

Permalink
fifo
Browse files Browse the repository at this point in the history
  • Loading branch information
Yikai-Liao committed Dec 21, 2023
1 parent 01678c7 commit 1bb8873
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/minimidi
Submodule minimidi updated 1 files
+2 −1 README.md
8 changes: 7 additions & 1 deletion include/Score.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,13 @@ minimidi::file::MidiFile Score<T>::to_midi() const {
));
}
// add notes
for(const auto &note: track.notes) {
vec<Note<T>> notes {track.notes};
pdqsort_branchless(notes.begin(), notes.end(), [](const Note<T> &a, const Note<T> &b) {
if (a.time != b.time) return (a.time) < (b.time);
return a.duration < b.duration;
});

for(const auto &note: notes) {
msgs.emplace_back(message::Message::NoteOn(
this->convert_ttype<Tick>(note.time), channel,
note.pitch, note.velocity
Expand Down

0 comments on commit 1bb8873

Please sign in to comment.