Rename steepness to knee

This commit is contained in:
Roderick van Domburg 2021-03-14 14:28:16 +01:00
parent 5f26a745d7
commit 309e26456e
3 changed files with 12 additions and 19 deletions

View file

@ -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,
}

View file

@ -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 =

View file

@ -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::<f32>().expect("Invalid release float value"))
.unwrap_or(PlayerConfig::default().normalisation_release * MILLIS)
/ MILLIS,
normalisation_steepness: matches
.opt_str("normalisation-steepness")
.map(|steepness| {
steepness
.parse::<f32>()
.expect("Invalid steepness float value")
})
.unwrap_or(PlayerConfig::default().normalisation_steepness),
normalisation_knee: matches
.opt_str("normalisation-knee")
.map(|knee| knee.parse::<f32>().expect("Invalid knee float value"))
.unwrap_or(PlayerConfig::default().normalisation_knee),
passthrough,
}
};