summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/midi_region.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index ee5d6e86df..979ea02b49 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -533,6 +533,7 @@ MidiRegion::render (Evoral::EventSink<samplepos_t>& dst,
#endif
MidiCursor cursor;
+ MidiStateTracker tracker;
/* This call reads events from a source and writes them to `dst' timed in session samples */
@@ -544,12 +545,18 @@ MidiRegion::render (Evoral::EventSink<samplepos_t>& dst,
_start + internal_offset + _length,
0,
cursor,
- 0,
+ &tracker,
filter,
_filtered_parameters,
quarter_note(),
_start_beats);
+ /* resolve any notes that were "cut off" by the end of the region. The
+ * Note-Off's get inserted at the end of the region
+ */
+
+ tracker.resolve_notes (dst, _position - _start + _length);
+
return 0;
}