Skip to content

Commit

Permalink
Snap sliders to edges
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Horacek <[email protected]>
  • Loading branch information
phoracek committed Feb 19, 2024
1 parent c28d464 commit 0a4a330
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ backwards compatibility.

## Unreleased

* Snap position sliders to the edges.

## 1.3.1

* Prevent accidental control mapping of noisy pots.
Expand Down
5 changes: 4 additions & 1 deletion control/src/cache/reconcile/heads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0a4a330

Please sign in to comment.