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

Method DelayDSPKernel

src/internal/src/DelayDSPKernel.cpp:20–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18const float SmoothingTimeConstant = 0.020f; // 20ms
19
20DelayDSPKernel::DelayDSPKernel(DelayProcessor * processor, float sampleRate)
21 : AudioDSPKernel(processor)
22 , m_writeIndex(0)
23 , m_firstTime(true)
24 , m_delayTimes(AudioNode::ProcessingSizeInFrames)
25{
26 ASSERT(processor);
27 if (!processor)
28 return;
29
30 m_maxDelayTime = processor->maxDelayTime();
31 ASSERT(m_maxDelayTime >= 0);
32 if (m_maxDelayTime < 0)
33 return;
34
35 m_buffer.allocate((int) bufferLengthForDelay(m_maxDelayTime, sampleRate));
36 m_buffer.zero();
37
38 m_smoothingRate = AudioUtilities::discreteTimeConstantForSampleRate(SmoothingTimeConstant, sampleRate);
39}
40
41DelayDSPKernel::DelayDSPKernel(double maxDelayTime, float sampleRate)
42 : AudioDSPKernel()

Callers

nothing calls this directly

Calls 3

allocateMethod · 0.80
maxDelayTimeMethod · 0.45
zeroMethod · 0.45

Tested by

no test coverage detected