From 1400fe012e6c4b1958ece1ddef4ca1b72982f52a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 27 Oct 2025 11:09:54 -0600 Subject: [PATCH] clip recording: store tempo and meter for audio files created during clip recording Information taken from the timeline - we assume you're going to play in time with the tempo map. Future work: no other material in session - determine tempo (and meter? - super hard) from recorded clip --- libs/ardour/triggerbox.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 6256a98021..a39f9db881 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -5771,19 +5771,26 @@ TriggerBoxThread::build_audio_source (AudioTrigger* t, Temporal::timecnt_t const ++n; } - /* now build region */ - - PropertyList plist; std::shared_ptr fs; + SegmentDescriptor segment; + Temporal::TempoMap::SharedPtr tmap (Temporal::TempoMap::use()); + segment.set_extent (0, t->data_length()); + segment.set_tempo (tmap->tempo_at (pos)); + segment.set_meter (tmap->meter_at (pos)); + for (auto & src : sources) { fs = std::dynamic_pointer_cast (src); fs->mark_immutable (); + src->set_segment_descriptor (segment); SourceFactory::setup_peakfile (src, false); } fs = std::dynamic_pointer_cast (sources.front()); assert (fs); + /* now build region */ + + PropertyList plist; std::string region_name = region_name_from_path (fs->path(), true, false);