13
0

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
This commit is contained in:
Paul Davis 2021-05-08 09:13:32 -06:00
parent 9d7ded8bfe
commit 6ca18bfcfd

View File

@ -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;
}
}
}