MCPcopy Create free account
hub / github.com/VCVRack/Befaco / gainFunction

Function gainFunction

src/HexmixVCA.cpp:5–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3using simd::float_4;
4
5static float gainFunction(float x, float shape) {
6 float lin = x;
7 if (shape > 0.f) {
8 float log = 11.f * x / (10.f * x + 1.f);
9 return crossfade(lin, log, shape);
10 }
11 else {
12 float exp = std::pow(x, 4);
13 return crossfade(lin, exp, -shape);
14 }
15}
16
17struct HexmixVCA : Module {
18 enum ParamIds {

Callers 1

processMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected