From 6ca18bfcfd337509f5109d8e8282998f4903e0c7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 8 May 2021 09:13:32 -0600 Subject: [PATCH] tweak gradual rewind/ffwd action to move in 4 semitone steps once the speed is below "one octave down" This avoids taking forever to get to -40st, where we reverse direction --- gtk2_ardour/ardour_ui.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 336f2b8dd3..c6634856c9 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2001,6 +2001,7 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd) // (keypress auto-repeat is 100ms) const float maxspeed = Config->get_shuttle_max_speed(); float semitone_ratio = exp2f (1.0f/12.0f); + float octave_down = pow (1.0/semitone_ratio, 12.0); float transport_speed = _session->actual_speed(); float speed; @@ -2049,12 +2050,21 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd) if (fwd) { if (transport_speed < 0.f) { /* we need to move the speed back towards zero */ - semitone_ratio = 1.0/semitone_ratio; + if (fabs (transport_speed) < octave_down) { + semitone_ratio = pow (1.0/semitone_ratio, 4.0); + } else { + semitone_ratio = 1.0/semitone_ratio; + } } } else { if (transport_speed > 0.f) { /* we need to move the speed back towards zero */ - semitone_ratio = 1.0/semitone_ratio; + + if (transport_speed < octave_down) { + semitone_ratio = pow (1.0/semitone_ratio, 4.0); + } else { + semitone_ratio = 1.0/semitone_ratio; + } } }