Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mtytel
mtytel / gist:e7e90604fa38bad60a512aac55c9e261
Created October 31, 2018 16:07
clipped exponential power scale
float powerScale(mono_float value, mono_float power) {
static constexpr float kMinPower = 0.01f;
if (fabsf(power) < kMinPower)
return value;
float numerator = mopo::futils::exp(power * value) - 1.0f;
float denominator = mopo::futils::exp(power) - 1.0f;
return numerator / denominator;
}