diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index 747b5608ba..a25092ac8c 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -114,6 +114,7 @@ class LIBARDOUR_API MidiRegion : public Region NoteMode mode, timepos_t const & read_start, timecnt_t const & read_length, + timepos_t const & source_position, MidiChannelFilter* filter) const; protected: diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 6caf61833b..3b13dbdd90 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -283,7 +283,7 @@ MidiRegion::render (Evoral::EventSink& dst, NoteMode mode, MidiChannelFilter* filter) const { - return render_range (dst, chan_n, mode, this->start(), _length, filter); + return render_range (dst, chan_n, mode, this->start(), _length, source_position(), filter); } int @@ -292,6 +292,7 @@ MidiRegion::render_range (Evoral::EventSink& dst, NoteMode mode, timepos_t const & read_start, timecnt_t const & read_length, + timepos_t const & source_position, MidiChannelFilter* filter) const { /* precondition: caller has verified that we cover the desired section */ @@ -327,7 +328,7 @@ MidiRegion::render_range (Evoral::EventSink& dst, src->midi_read ( lm, // source lock dst, // destination buffer - this->source_position(), // start position of the source in session samples + source_position, // start position of the source in session samples read_start, read_length, 0, @@ -340,7 +341,7 @@ MidiRegion::render_range (Evoral::EventSink& dst, * Note-Off's get inserted at the end of the region */ - const timepos_t end = source_position() + read_start + read_length; + const timepos_t end = source_position + read_start + read_length; tracker.resolve_notes (dst, end.samples()); return 0;