From 4f8a6e8e80a5e3ca9c85b3fc61be43f73429b17a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 3 Apr 2025 21:01:45 +0200 Subject: [PATCH] Fix stretching mono files on multi-channel trigger slots Like in the non-stretch case `chn % data.size ()` is used. --- libs/ardour/triggerbox.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 637060aa64..03d2593219 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -2178,10 +2178,10 @@ AudioTrigger::audio_run (BufferSet& bufs, samplepos_t start_sample, samplepos_t * the end of the region */ - std::vector in(nchans); + float** in = (float**)alloca(nchans * sizeof (float*)); for (uint32_t chn = 0; chn < nchans; ++chn) { - in[chn] = data[chn] + read_index; + in[chn] = data[chn % data.size ()] + read_index; } /* Note: RubberBandStretcher's process() and retrieve() API's accepts Sample**