From efdc47bc74a436a963ceb921a6e31956f12e2469 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 27 Oct 2022 17:35:56 -0600 Subject: [PATCH] fix MidiRegion::merge() to allow final events of a region to be part of the newly merged result --- libs/ardour/midi_region.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index d4311e7bff..9a74fc71d2 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -564,15 +564,16 @@ MidiRegion::merge (boost::shared_ptr other_region) for (Evoral::Sequence::const_iterator e = other->begin(); e != other->end(); ++e) { - std::cerr << "event " << *e << " @ " << e->time().str() << " vs " << other_region_start.str() << " .. " << other_region_end.str() << " other = " << other << std::endl; - if (e->time() < other_region_start) { continue; } - /* other_region_end is an exclusive end, not inclusive */ + /* other_region_end is an inclusive end, not + * exclusive, since we allow simultaneous MIDI events + * (given appropriate semantic sorting) + */ - if (e->time() >= other_region_end) { + if (e->time() > other_region_end) { break; }