diff --git a/playback/src/config.rs b/playback/src/config.rs index 80771582..312f1709 100644 --- a/playback/src/config.rs +++ b/playback/src/config.rs @@ -107,7 +107,7 @@ pub struct PlayerConfig { pub normalisation_threshold: f32, pub normalisation_attack: f32, pub normalisation_release: f32, - pub normalisation_steepness: f32, + pub normalisation_knee: f32, pub gapless: bool, pub passthrough: bool, } @@ -123,7 +123,7 @@ impl Default for PlayerConfig { normalisation_threshold: -1.0, normalisation_attack: 0.005, normalisation_release: 0.1, - normalisation_steepness: 1.0, + normalisation_knee: 1.0, gapless: true, passthrough: false, } diff --git a/playback/src/player.rs b/playback/src/player.rs index dbc09695..0a573c93 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -271,10 +271,7 @@ impl NormalisationData { if config.normalisation_method == NormalisationMethod::Dynamic { debug!("Normalisation Attack: {:?}", config.normalisation_attack); debug!("Normalisation Release: {:?}", config.normalisation_release); - debug!( - "Normalisation Steepness: {:?}", - config.normalisation_steepness - ); + debug!("Normalisation Knee: {:?}", config.normalisation_knee); } normalisation_factor @@ -1176,7 +1173,7 @@ impl PlayerInternal { if self.config.normalisation_method == NormalisationMethod::Dynamic { if self.limiter_active { - // "S"-shaped curve with a configurable steepness during attack and release: + // "S"-shaped curve with a configurable knee during attack and release: // - > 1.0 yields soft knees at start and end, steeper in between // - 1.0 yields a linear function from 0-100% // - between 0.0 and 1.0 yields hard knees at start and end, flatter in between @@ -1191,7 +1188,7 @@ impl PlayerInternal { + f32::powf( shaped_limiter_strength / (1.0 - shaped_limiter_strength), - -1.0 * self.config.normalisation_steepness, + -1.0 * self.config.normalisation_knee, )); } actual_normalisation_factor = diff --git a/src/main.rs b/src/main.rs index b4cfc437..bf553a86 100644 --- a/src/main.rs +++ b/src/main.rs @@ -238,9 +238,9 @@ fn setup(args: &[String]) -> Setup { ) .optopt( "", - "normalisation-steepness", - "Steepness of the dynamic limiting curve. Default is 1.0.", - "STEEPNESS", + "normalisation-knee", + "Knee steepness of the dynamic limiter. Default is 1.0.", + "KNEE", ) .optopt( "", @@ -475,14 +475,10 @@ fn setup(args: &[String]) -> Setup { .map(|release| release.parse::().expect("Invalid release float value")) .unwrap_or(PlayerConfig::default().normalisation_release * MILLIS) / MILLIS, - normalisation_steepness: matches - .opt_str("normalisation-steepness") - .map(|steepness| { - steepness - .parse::() - .expect("Invalid steepness float value") - }) - .unwrap_or(PlayerConfig::default().normalisation_steepness), + normalisation_knee: matches + .opt_str("normalisation-knee") + .map(|knee| knee.parse::().expect("Invalid knee float value")) + .unwrap_or(PlayerConfig::default().normalisation_knee), passthrough, } };