From 209fc01558997cd5a50e86a830ad1e35ddf7fd0e Mon Sep 17 00:00:00 2001 From: Bart Brouns Date: Thu, 24 Oct 2024 21:37:00 +0200 Subject: [PATCH] don't reset after learning --- src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7df62e2..9ec53b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -668,9 +668,6 @@ impl Del2 { self.learned_notes .store(self.learning_index.load(Ordering::SeqCst), note); self.last_played_notes.note_off(note); - self.counting_state = CountingState::TimeOut; - self.timing_last_event = 0; - self.samples_since_last_event = 0; } // Check for timeout condition and reset if necessary @@ -679,7 +676,7 @@ impl Del2 { self.timing_last_event = 0; self.samples_since_last_event = 0; } else if should_record_tap - && !matches!(self.counting_state, CountingState::TimeOut) + && self.counting_state != CountingState::TimeOut && self.samples_since_last_event > 0 && velocity > 0.0 {