MCPcopy Create free account
hub / github.com/LabSound/LabSound / kneeCurve

Method kneeCurve

src/internal/src/DynamicsCompressorKernel.cpp:80–87  ·  view source on GitHub ↗

Exponential curve for the knee. It is 1st derivative matched at m_linearThreshold and asymptotically approaches the value m_linearThreshold + 1 / k.

Source from the content-addressed store, hash-verified

78// Exponential curve for the knee.
79// It is 1st derivative matched at m_linearThreshold and asymptotically approaches the value m_linearThreshold + 1 / k.
80float DynamicsCompressorKernel::kneeCurve(float x, float k)
81{
82 // Linear up to threshold.
83 if (x < m_linearThreshold)
84 return x;
85
86 return m_linearThreshold + (1 - expf(-k * (x - m_linearThreshold))) / k;
87}
88
89// Full compression curve with constant ratio after knee.
90float DynamicsCompressorKernel::saturate(float x, float k)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected