From 572a69758a76e0c713444df248658ce84a9c4c5c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 19 Jul 2021 17:28:25 +0200 Subject: [PATCH] Min playback speed is +/- (100/16)% This is for at least two reasons: transport will effectively move with 32 samples * 6.25% = 2 samples per cycle and the resampler cannot up/downsample a factor of > 16 with reasonable quality. --- libs/ardour/session_transport.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 82576f019f..2dcd02a877 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -321,6 +321,15 @@ Session::default_play_speed () void Session::set_default_play_speed (double spd) { + /* see also Port::set_speed_ratio and + * VMResampler::set_rratio() for min/max range. + * speed must be > +/- 100 / 16 % + */ + if (spd > 0.0) { + spd = std::min (Config->get_max_transport_speed(), std::max (0.0625, spd)); + } else if (spd < 0.0) { + spd = std::max (- Config->get_max_transport_speed(), std::min (-0.0625, spd)); + } _transport_fsm->set_default_speed(spd); TFSM_SPEED(spd); TransportStateChange (); /* EMIT SIGNAL */