From 78042ed4c59674ed613a8c9cdc82a88bcc0eceba Mon Sep 17 00:00:00 2001 From: Vesa Date: Mon, 17 Nov 2014 18:55:09 +0200 Subject: [PATCH] More exp10 stuff --- include/lmms_math.h | 2 +- plugins/monstro/Monstro.cpp | 4 ++-- src/gui/widgets/knob.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index 2d03471df..47136ae94 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -209,7 +209,7 @@ static inline float dbvToAmp( float dbv ) { return isinff( dbv ) ? 0.0f - : powf( 10.0f, dbv * 0.05f ); + : exp10f( dbv * 0.05f ); } diff --git a/plugins/monstro/Monstro.cpp b/plugins/monstro/Monstro.cpp index 69f025552..1d0d25812 100644 --- a/plugins/monstro/Monstro.cpp +++ b/plugins/monstro/Monstro.cpp @@ -1439,14 +1439,14 @@ void MonstroInstrument::updateSamplerate() void MonstroInstrument::updateSlope1() { const float slope = m_env1Slope.value(); - m_slope1 = powf( 10.0f, slope * -1.0f ); + m_slope1 = exp10f( slope * -1.0f ); } void MonstroInstrument::updateSlope2() { const float slope = m_env2Slope.value(); - m_slope2 = powf( 10.0f, slope * -1.0f ); + m_slope2 = exp10f( slope * -1.0f ); } diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 70e4dbec1..1a2feef5b 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -734,7 +734,7 @@ void knob::enterValue() } else { - new_val = pow( 10.0, ( new_val / 20.0 ) ) * 100.0; + new_val = dbvToAmp( new_val ) * 100.0; } } else