From bc706064c6be9ed740961e1b49d8a469b2b17a0b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 18 Oct 2019 20:05:22 -0600 Subject: use a note tracker to resolve notes cut off during render by the end of the region --- libs/ardour/midi_region.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/ardour/midi_region.cc') 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& 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& 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; } -- cgit v1.2.3