From 0a4a330ca1eae1402c6e8d2db1c1a3618149f786 Mon Sep 17 00:00:00 2001 From: Petr Horacek Date: Mon, 19 Feb 2024 23:58:16 +0100 Subject: [PATCH] Snap sliders to edges Signed-off-by: Petr Horacek --- CHANGELOG.md | 2 ++ control/src/cache/reconcile/heads.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 452b5cc..3270c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ backwards compatibility. ## Unreleased +* Snap position sliders to the edges. + ## 1.3.1 * Prevent accidental control mapping of noisy pots. diff --git a/control/src/cache/reconcile/heads.rs b/control/src/cache/reconcile/heads.rs index 4429456..024446c 100644 --- a/control/src/cache/reconcile/heads.rs +++ b/control/src/cache/reconcile/heads.rs @@ -24,7 +24,10 @@ impl Store { } fn reconcile_position(&mut self, i: usize) { - let pot = self.input.head[i].position.last_value_above_noise; + // NOTE: Snap to the beginning and end to make sure it is possible to + // get to these extremes. + let pot_raw = self.input.head[i].position.last_value_above_noise; + let pot = ((pot_raw * 1.04) - 0.02).clamp(0.0, 1.0); let control_index = self.control_index_for_attribute(AttributeIdentifier::Position(i)); let cv = if let Some(i) = control_index {