11#ifndef MARVIN_DELAYLINE_H
12#define MARVIN_DELAYLINE_H
30 template <FloatType SampleType, DelayLineInterpolationType InterpolationType = DelayLineInterpolationType::Linear>
52 [[nodiscard]] SampleType
getDelay() const noexcept;
86 [[nodiscard]] SampleType
popSample(SampleType delayInSamples = -1,
bool updateReadPointer = true);
101 [[nodiscard]] SampleType interpolateSample();
102 void updateInternalVariables();
103 double m_sampleRate{};
104 std::vector<SampleType> m_bufferData{};
105 int m_writePos{ 0 }, m_readPos{ 0 };
106 SampleType m_delay{ 0.0 };
107 SampleType m_delayFrac{ 0.0 };
109 int m_totalSize{ 4 };
void setDelay(SampleType newDelayInSamples)
int getWritePos() const noexcept
int getReadPos() const noexcept
void setMaximumDelayInSamples(int maxDelayInSamples)
SampleType getDelay() const noexcept
SampleType popSample(SampleType delayInSamples=-1, bool updateReadPointer=true)
DelayLine(int maximumDelayInSamples)
void initialise(double sampleRate)
void pushSample(SampleType sample)
int getMaximumDelayInSamples() const noexcept
DSP helper and utility functions.
Definition marvin_DelayLine.h:15
DelayLineInterpolationType
Enum to configure the type of interpolation an instance of marvin::dsp::DelayLine should use.
Definition marvin_DelayLine.h:19
@ Linear
Definition marvin_DelayLine.h:21
@ Lagrange3rd
Definition marvin_DelayLine.h:22
@ None
Definition marvin_DelayLine.h:20