Skip to content

Commit 6ef2e2b

Browse files
committed
split midi tick if loop wrap
1 parent c35515e commit 6ef2e2b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

libs/ardour/session.cc

+12
Original file line numberDiff line numberDiff line change
@@ -7964,6 +7964,18 @@ Session::maybe_update_tempo_from_midiclock_tempo (float bpm)
79647964
void
79657965
Session::send_mclk_for_cycle (samplepos_t start_sample, samplepos_t end_sample, pframes_t n_samples, samplecnt_t pre_roll)
79667966
{
7967+
if (start_sample > end_sample) {
7968+
Location* loop = _locations->auto_loop_location();
7969+
assert (loop);
7970+
samplecnt_t start_n_samples = loop->end_sample() - start_sample;
7971+
samplecnt_t end_n_samples = end_sample - loop->start_sample();
7972+
if (start_n_samples + end_n_samples == n_samples) {
7973+
assert (pre_roll == 0);
7974+
midi_clock->tick (start_sample, loop->end_sample(), start_n_samples, 0);
7975+
midi_clock->tick (loop->start_sample(), end_sample, end_n_samples, 0);
7976+
return;
7977+
}
7978+
}
79677979
midi_clock->tick (start_sample, end_sample, n_samples, pre_roll);
79687980
}
79697981

0 commit comments

Comments
 (0)