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

Method setPreDelayTime

src/internal/src/DynamicsCompressorKernel.cpp:60–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void DynamicsCompressorKernel::setPreDelayTime(float preDelayTime, float sampleRate)
61{
62 // Re-configure look-ahead section pre-delay if delay time has changed.
63 int preDelayFrames = static_cast<int>(preDelayTime * sampleRate);
64 if (preDelayFrames > MaxPreDelayFrames - 1)
65 preDelayFrames = MaxPreDelayFrames - 1;
66
67 if (m_lastPreDelayFrames != preDelayFrames)
68 {
69 m_lastPreDelayFrames = preDelayFrames;
70 for (unsigned i = 0; i < m_preDelayBuffers.size(); ++i)
71 m_preDelayBuffers[i]->zero();
72
73 m_preDelayReadIndex = 0;
74 m_preDelayWriteIndex = preDelayFrames;
75 }
76}
77
78// Exponential curve for the knee.
79// It is 1st derivative matched at m_linearThreshold and asymptotically approaches the value m_linearThreshold + 1 / k.

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
zeroMethod · 0.45

Tested by

no test coverage detected