Skip to content

Commit

Permalink
Fix tap to resume logic
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Horacek <petr@zlosynth.com>
  • Loading branch information
phoracek committed Nov 13, 2023
1 parent f8e689c commit a1ed1f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion control/src/cache/reconcile/speed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ impl Store {
self.cache.requests.reset_impulse =
just_triggered_clock || just_triggered_tap || just_triggered_position_reset;

if just_triggered_tap {
self.cache.attributes.paused_delay = false;
self.cache.display.reset_paused();
}

if let Some(clock_tempo) = clock_tempo {
let c_i = f32_to_usize_5(self.input.speed.value());
let coefficient = [1.0, 1.0 / 2.0, 1.0 / 4.0, 1.0 / 8.0, 1.0 / 16.0][c_i];
self.cache.attributes.speed = (clock_tempo as f32 / 1000.0) * coefficient;
} else if let Some(tapped_tempo) = self.cache.tapped_tempo {
self.cache.attributes.speed =
tapped_tempo * self.cache.configuration.tap_interval_denominator as f32;
self.cache.attributes.paused_delay = false;
} else {
let (speed, display) = match self.cache.options.delay_range {
DelayRange::Long => self.speed_for_long_range(),
Expand Down

0 comments on commit a1ed1f0

Please sign in to comment.