This happens because the MIDI output starts at tick 0, regardless of
when the first event is. Initial grace notes start start at negative
ticks, so midi_walker::output_event thinks they're out of order. Fixed
by starting at the first event.
index_ = 0;
items_ = audio_staff->audio_items_;
vector_sort (items_, audio_item_less);
- last_tick_ = 0;
+ //Pieces that begin with grace notes start at negative times. This
+ //is OK - MIDI output doesn't use absolute ticks, only differences.
+ last_tick_ = items_.empty () ? 0 : items_[0]->audio_column_->ticks ();
percussion_ = audio_staff->percussion_;
merge_unisons_ = audio_staff->merge_unisons_;
}