projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tempo ramps - fix music-locked meter drags.
[ardour.git]
/
libs
/
ardour
/
ardour
/
dB.h
diff --git
a/libs/ardour/ardour/dB.h
b/libs/ardour/ardour/dB.h
index 0fd75a869f91677e8b7d6cb614373ddaec2e8ce7..1a4ed983abd3e5e1014ea6a0f6e5794b6a313657 100644
(file)
--- a/
libs/ardour/ardour/dB.h
+++ b/
libs/ardour/ardour/dB.h
@@
-20,11
+20,12
@@
#ifndef __ardour_dB_h__
#define __ardour_dB_h__
#ifndef __ardour_dB_h__
#define __ardour_dB_h__
+#include <limits>
#include "pbd/fastlog.h"
#include "pbd/fastlog.h"
-#define GAIN_COEFF_ZERO 0.
0
-#define GAIN_COEFF_SMALL 0.0000001 //-140dB
-#define GAIN_COEFF_UNITY 1.
0
+#define GAIN_COEFF_ZERO 0.
f
+#define GAIN_COEFF_SMALL 0.0000001
f
//-140dB
+#define GAIN_COEFF_UNITY 1.
f
static inline float dB_to_coefficient (float dB) {
return dB > -318.8f ? pow (10.0f, dB * 0.05f) : 0.0f;
static inline float dB_to_coefficient (float dB) {
return dB > -318.8f ? pow (10.0f, dB * 0.05f) : 0.0f;
@@
-35,6
+36,7
@@
static inline float fast_coefficient_to_dB (float coeff) {
}
static inline float accurate_coefficient_to_dB (float coeff) {
}
static inline float accurate_coefficient_to_dB (float coeff) {
+ if (coeff < 1e-15) return -std::numeric_limits<float>::infinity();
return 20.0f * log10f (coeff);
}
return 20.0f * log10f (coeff);
}