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

Function equalPowerCrossfade

src/Morphader.cpp:9–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8// equal power crossfade, -1 <= p <= 1
9template <typename T> inline T equalPowerCrossfade(T a, T b, const T p) {
10 // return std::min(std::exp(4.f * p), 1.f) * b + std::min(std::exp(4.f * -p), 1.f) * a;
11 return simd::fmin(exponentialBipolar80Pade_5_4(p + 1), 1.f) * b + simd::fmin(exponentialBipolar80Pade_5_4(1 - p), 1.f) * a;
12}
13
14// TExponentialSlewLimiter doesn't appear to work as is required for this application.
15// I think it is due to the absence of the logic that stops the output rising / falling too quickly,

Callers 1

processMethod · 0.85

Calls 1

Tested by

no test coverage detected