fix: refactor get_precision_adjusted_beat_len

This commit is contained in:
MaxOhn
2024-10-11 16:58:48 +02:00
parent 315d4b3c9e
commit 14c646d9e1
5 changed files with 20 additions and 43 deletions
+12
View File
@@ -7,3 +7,15 @@ pub mod sort;
pub mod special_functions;
pub mod strains_vec;
pub mod sync;
pub fn get_precision_adjusted_beat_len(slider_velocity_multiplier: f64, beat_len: f64) -> f64 {
let slider_velocity_as_beat_len = -100.0 / slider_velocity_multiplier;
let bpm_multiplier = if slider_velocity_as_beat_len < 0.0 {
f64::from(((-slider_velocity_as_beat_len) as f32).clamp(10.0, 10_000.0)) / 100.0
} else {
1.0
};
beat_len * bpm_multiplier
}