13
0

use a note tracker to resolve notes cut off during render by the end of the region

This commit is contained in:
Paul Davis 2019-10-18 20:05:22 -06:00
parent 5d40ab22fd
commit bc706064c6

View File

@ -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;
}