Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
agourlay committed Dec 8, 2024
1 parent b2dcc82 commit a8f95f4
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/audio/midi_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,7 @@ fn apply_velocity_effect(
} else if effect.heavy_accentuated_note {
velocity = MIN_VELOCITY.max(velocity + VELOCITY_INCREMENT * 2);
}
if velocity > 127 {
127
} else {
velocity
}
velocity.min(127)
}

fn apply_duration_effect(
Expand Down Expand Up @@ -713,11 +709,7 @@ fn apply_duration_effect(

fn apply_static_duration(tempo: i32, duration: i32, maximum: usize) -> usize {
let value = (tempo * duration / 60) as usize;
if value < maximum {
value
} else {
maximum
}
value.min(maximum)
}

#[cfg(test)]
Expand Down

0 comments on commit a8f95f4

Please sign in to comment.