diff options
author | Minijackson <minijackson@riseup.net> | 2018-09-04 12:33:44 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-09-04 12:33:44 +0200 |
commit | 515870c9e8ff833e50f5253ec6e6d43de97519ed (patch) | |
tree | 996a665bebfe847fe8c2ebdb371b3f15f3ce332f /src/parsing/equalizer_apo.lalrpop | |
parent | a903881e79f30f73d0008f88c4b245defbe5b5c1 (diff) | |
download | set_eq-515870c9e8ff833e50f5253ec6e6d43de97519ed.tar.gz set_eq-515870c9e8ff833e50f5253ec6e6d43de97519ed.zip |
Rust stable compatibility + use amplitude decibel conversion
Diffstat (limited to 'src/parsing/equalizer_apo.lalrpop')
-rw-r--r-- | src/parsing/equalizer_apo.lalrpop | 2 |
1 files changed, 1 insertions, 1 deletions
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; | |||
6 | 6 | ||
7 | pub Main: Filter = { | 7 | pub Main: Filter = { |
8 | <preamp: Preamp> <eq: Eq> => { | 8 | <preamp: Preamp> <eq: Eq> => { |
9 | let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64)).collect(); | 9 | let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64).sqrt()).collect(); |
10 | // TODO: add decibel_to_ratio conversion function | 10 | // TODO: add decibel_to_ratio conversion function |
11 | let preamp = 10f64.powf(preamp / 10f64); | 11 | let preamp = 10f64.powf(preamp / 10f64); |
12 | Filter { preamp, frequencies: eq.0, coefficients } | 12 | Filter { preamp, frequencies: eq.0, coefficients } |