From 6a55146fdc2ecc046334d44cc4176db7373f4d4d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 21 Oct 2022 12:40:30 +0200 Subject: [PATCH] Fix music-time parameter automation #9019 Music-time has a significantly reduced resolution. When evaluating parameter automation using sample-time, different samples can be mapped back to the same beat-tick. This can result in endless loops. The same automation event is found again: ``` start: 112640 next_event.when: b13334 -> dist a5892029@a662323200 in dist.samples: 1002 start: 113642 next_event.when: b13334 -> dist a269@a668214960 dist.samples: 0 ``` Note this fix may not be correct, since time-domains are mixed. "end" is using sample-time. Furthermore The loop is only entered if there is an event found using timepos_t(start). Further work will be required (ideally use the same resolution for all time-domains, or force everything that is evaluated in RT-context to a single time-domain) --- libs/ardour/plugin_insert.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 10ccf7ecfb..46795dc807 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -1389,7 +1389,7 @@ PluginInsert::automate_and_run (BufferSet& bufs, samplepos_t start, samplepos_t map_loop_range (start, end); - if (!find_next_event (timepos_t (start), timepos_t (end), next_event)) { + if (!find_next_event (next_event.when, timepos_t (end), next_event)) { break; } }