From 515870c9e8ff833e50f5253ec6e6d43de97519ed Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 4 Sep 2018 12:33:44 +0200 Subject: Rust stable compatibility + use amplitude decibel conversion --- src/parsing/equalizer_apo.lalrpop | 2 +- src/parsing/equalizer_apo.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/parsing') diff --git a/src/parsing/equalizer_apo.lalrpop b/src/parsing/equalizer_apo.lalrpop index b1faad9..39dda67 100644 --- a/src/parsing/equalizer_apo.lalrpop +++ b/src/parsing/equalizer_apo.lalrpop @@ -6,7 +6,7 @@ grammar; pub Main: Filter = { => { - let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64)).collect(); + let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64).sqrt()).collect(); // TODO: add decibel_to_ratio conversion function let preamp = 10f64.powf(preamp / 10f64); Filter { preamp, frequencies: eq.0, coefficients } diff --git a/src/parsing/equalizer_apo.rs b/src/parsing/equalizer_apo.rs index 3fab396..a24cf99 100644 --- a/src/parsing/equalizer_apo.rs +++ b/src/parsing/equalizer_apo.rs @@ -1,5 +1,5 @@ // auto-generated: "lalrpop 0.15.2" -// sha256: 81b6fa5856d7887b20715c2c7f6137db1927ece087e2db9f4bf1fcd8943365c5 +// sha256: a735e8f9bd5cf5f3aac915d12b24752d366481c3952258e22871eef395f44 use ::Filter; use std::str::FromStr; #[allow(unused_extern_crates)] @@ -880,7 +880,7 @@ fn __action1< ) -> Filter { { - let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64)).collect(); + let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64).sqrt()).collect(); // TODO: add decibel_to_ratio conversion function let preamp = 10f64.powf(preamp / 10f64); Filter { preamp, frequencies: eq.0, coefficients } -- cgit v1.2.3