24 #include <glibmm/threads.h>
34 LogCurve (
float steepness = 0.2, uint32_t len = 0) {
38 b = 1.0f / log(1.0f + (1.0f / S));
42 return S == other.
S && l == other.
l;
45 bool operator!= (
const LogCurve& other)
const {
46 return S != other.
S || l != other.
l;
49 float value (
float frac)
const {
53 float value (uint32_t pos)
const {
54 return (
fast_log(((
float) pos/l) + S) - a) * b;
62 return (a -
fast_log(((
float) pos/l) + S)) * b;
65 void fill (
float *vec, uint32_t veclen,
bool invert)
const {
66 float dx = 1.0f/veclen;
75 for (i = 1, x = 0; i < veclen - 1; x += dx, i++) {
84 for (i = veclen-2, x = 0.0f; i > 0; x += dx, i--) {
91 uint32_t
length()
const {
return l; }
96 b = 1.0f / log(1.0f + (1.0f / S));
100 mutable Glib::Threads::Mutex
lock;
116 return (
fast_log(frac + S) - a) * b;
120 return (
fast_log(((
float) pos/l) + S) - a) * b;
float value(float frac) const
LogCurveIn(float steepness=0.2, uint32_t len=0)
float value(uint32_t pos) const
LogCurveOut(float steepness=0.2, uint32_t len=0)
float invert_value(uint32_t pos) const
void fill(float *vec, uint32_t veclen, bool invert) const
float invert_value(float frac) const
void set_steepness(float steepness)
float value(uint32_t pos) const
LogCurve(float steepness=0.2, uint32_t len=0)
Glib::Threads::Mutex lock
float value(float frac) const
void set_length(uint32_t len)
static float fast_log(const float val)
bool operator==(const ProcessorSelection &a, const ProcessorSelection &b)