26 #define TINY_NUMBER (0.0000001)
35 return pow ((6.0 * log (g) / log (2.0) + 192.0) / 198.0, 8.0);
45 return exp (((pow (pos, 1.0 / 8.0) * 198.0) - 192.0) / 6.0 * log (2.0));
52 assert (upper > lower && lower * upper > 0);
53 assert (pos >= 0.0 && pos <= 1.0);
54 return lower * pow (upper / lower, pos);
61 assert (upper > lower && lower * upper > 0);
62 assert (val >= lower && val <= upper);
63 return log (val / lower) / log (upper / lower);
71 return round (v) / (steps - 1.0);
78 double p = round (pos * (steps - 1.0)) / (steps - 1.0);
86 return from + (fraction * (to - from));
98 assert (from > 0 && from * to > 0);
99 assert (fraction >= 0 && fraction <= 1);
100 return from * pow (to / from, fraction);
116 double diff = g1 - g0;
static double gain_to_position(double g)
static double position_to_logscale_with_steps(double pos, double lower, double upper, uint32_t steps)
static double interpolate_gain(double f, double t, double fraction, double upper)
static double logscale_to_position_with_steps(double val, double lower, double upper, uint32_t steps)
static double position_to_gain(double pos)
static double position_to_logscale(double pos, double lower, double upper)
static double logscale_to_position(double val, double lower, double upper)
static double interpolate_linear(double from, double to, double fraction)
static double interpolate_logarithmic(double from, double to, double fraction, double, double)