diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-30 21:59:07 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-30 22:25:21 +0200 |
commit | 3df530e7f6521a74d5184c6de04589cd762c5f12 (patch) | |
tree | 97320fc76b9d9cbb2f4abc3cdc1b3fe5af6f18b9 /libs/plugins/a-exp.lv2 | |
parent | 070d8f5ee1473baab294fdfb21e1dda73995b444 (diff) |
Clean up double/float narrowing math in plugins.
Diffstat (limited to 'libs/plugins/a-exp.lv2')
-rw-r--r-- | libs/plugins/a-exp.lv2/a-exp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/plugins/a-exp.lv2/a-exp.c b/libs/plugins/a-exp.lv2/a-exp.c index c90611517f..7f13e1a2ff 100644 --- a/libs/plugins/a-exp.lv2/a-exp.c +++ b/libs/plugins/a-exp.lv2/a-exp.c @@ -268,12 +268,12 @@ sanitize_denormal(float value) { static inline float from_dB(float gdb) { - return (exp(gdb/20.f*log(10.f))); + return powf (10.0f, 0.05f * gdb); } static inline float to_dB(float g) { - return (20.f*log10(g)); + return (20.f * log10f (g)); } static void @@ -302,8 +302,8 @@ run(LV2_Handle instance, uint32_t n_samples) float srate = aexp->srate; float width = (6.f * *(aexp->knee)) + 0.01; - float attack_coeff = exp(-1000.f/(*(aexp->attack) * srate)); - float release_coeff = exp(-1000.f/(*(aexp->release) * srate)); + float attack_coeff = expf (-1000.f / (*(aexp->attack) * srate)); + float release_coeff = expf (-1000.f / (*(aexp->release) * srate)); float max_out = 0.f; float Lgain = 1.f; @@ -325,7 +325,7 @@ run(LV2_Handle instance, uint32_t n_samples) float makeup_target = from_dB(makeup); float makeup_gain = aexp->makeup_gain; - const float tau = (1.0 - exp (-2.f * M_PI * 25.f / aexp->srate)); + const float tau = (1.f - expf (-2.f * M_PI * 25.f / aexp->srate)); if (*aexp->enable <= 0) { ratio = 1.f; |