20 #ifndef __ardour_logcurve_h__
21 #define __ardour_logcurve_h__
24 #include <glibmm/threads.h>
30 LogCurve (
float steepness = 0.2, uint32_t len = 0) {
34 b = 1.0f / log(1.0
f + (1.0
f / S));
38 return S == other.
S && l == other.
l;
42 return S != other.
S || l != other.
l;
45 float value (
float frac)
const {
49 float value (uint32_t pos)
const {
50 return (
fast_log(((
float) pos/l) + S) - a) * b;
58 return (a -
fast_log(((
float) pos/l) + S)) * b;
61 void fill (
float *vec, uint32_t veclen,
bool invert)
const {
62 float dx = 1.0f/veclen;
71 for (i = 1, x = 0; i < veclen - 1; x += dx, i++) {
80 for (i = veclen-2, x = 0.0
f; i > 0; x += dx, i--) {
87 uint32_t
length()
const {
return l; }
92 b = 1.0f / log(1.0
f + (1.0
f / S));
96 mutable Glib::Threads::Mutex
lock;
112 return (
fast_log(frac + S) - a) * b;
116 return (
fast_log(((
float) pos/l) + S) - a) * b;
Glib::Threads::Mutex lock
float value(float frac) const
bool operator!=(shared_ptr< T > const &a, shared_ptr< U > const &b)
static float fast_log(const float val)
float value(uint32_t pos) const
void set_length(uint32_t len)
float invert_value(float frac) const
LogCurve(float steepness=0.2, uint32_t len=0)
float value(uint32_t pos) const
LogCurveOut(float steepness=0.2, uint32_t len=0)
float value(float frac) const
float invert_value(uint32_t pos) const
LogCurveIn(float steepness=0.2, uint32_t len=0)
void fill(float *vec, uint32_t veclen, bool invert) const
bool operator==(const RouteProcessorSelection &a, const RouteProcessorSelection &b)
void set_steepness(float steepness)