Skip to content

Commit

Permalink
#184 Implement discrete normalization to source interval
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed May 22, 2021
1 parent e400d90 commit aba59f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions main/src/domain/main_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ impl<EH: DomainEventHandler> Basics<EH> {
}
let context = self.control_context();
if let Some(reference_value) = m.current_aggregated_target_value(context) {
let target_value = reference_value.map_to_unit_interval_from(
let target_value = reference_value.normalize(
&m.mode().target_value_interval,
MinIsMaxBehavior::PreferOne,
BASE_EPSILON,
Expand All @@ -1942,9 +1942,7 @@ impl<EH: DomainEventHandler> Basics<EH> {
group_id,
|other_mapping, basics| {
let scaled_interaction_value = interaction_value
.map_from_unit_interval_to(
&other_mapping.mode().target_value_interval,
);
.denormalize(&other_mapping.mode().target_value_interval);
other_mapping.control_from_target(
ControlValue::AbsoluteContinuous(scaled_interaction_value),
ControlOptions::default(),
Expand Down

0 comments on commit aba59f5

Please sign in to comment.