37 template<u
int32_t MaxWindow>
43 template<
class InterpolatorT = Thiran1stInterpolator>
83 mGainA = 0.5f * (1.0f +
cosf(std::numbers::pi_v<float> *
alpha));
84 mGainB = 1.0f - mGainA;
96 mLastDelay = mNewDelay;
97 mNewDelay =
static_cast<int>(
delay);
114 return tapA * mGainA +
tapB * mGainB;
129 template<u
int32_t MaxWindow = 2>
137 std::vector<float> mBuffer;
144 , mBuffer(mIndex.GetTotalSize(), 0.0f)
156 template<
class TapType>
requires (TapType::InterpolatorType::InputLength <=
WindowSize)
164 template<
class Interpolator>
requires (Interpolator::InputLength <=
WindowSize)
174 inline const float*
raw()
const {
return mBuffer.data(); }
178 std::fill(mBuffer.begin(), mBuffer.end(), 0.0f);
216 template<u
int32_t WindowLength>
requires (
WindowLength <= 1)
#define JPL_ASSERT(inExpression,...)
Main assert macro, usage: JPL_ASSERT(condition, message) or JPL_ASSERT(condition)
Definition ErrorReporting.h:76
Forward declaration.
Definition AbstractIndex.h:83
uint32_t GetRingSize() const
Definition AbstractIndex.h:106
void Reset()
Definition AbstractIndex.h:108
uint32_t GetOffset(uint32_t offset) const
Get the index of the sample at an offset from the WriteIndex.
Definition AbstractIndex.h:141
Index GetCurrent() const
Definition AbstractIndex.h:107
uint32_t GetTotalSize() const
Get total size of the ring buffer including MaxWindow mirror length.
Definition AbstractIndex.h:105
Forward declaration.
Definition DelayLine.h:131
uint32_t GetSize() const
Definition DelayLine.h:172
void Resize(uint32_t newSize)
Definition DelayLine.h:150
DelayLine()
Definition DelayLine.h:148
uint32_t GetWriteIndex() const
Definition DelayLine.h:173
std::span< const float, WindowLength > GetReadWindow(uint32_t intDelay) const
Definition DelayLine.h:202
void Clear()
Definition DelayLine.h:176
static constexpr uint32_t WindowSize
Definition DelayLine.h:133
void Push(float sample)
Definition DelayLine.h:183
float GetReadWindow(uint32_t intDelay) const
Definition DelayLine.h:217
static DelayTap< Interpolator > CreateTap(float initialDelay=0.0f)
Definition DelayLine.h:165
const float * raw() const
Definition DelayLine.h:174
static TapType CreateTap(float initialDelay=0.0f)
Definition DelayLine.h:157
DelayLine(uint32_t minSize)
Definition DelayLine.h:142
Definition AcousticMaterial.h:36
JPL_INLINE simd min(const simd &a, const simd &b) noexcept
Element-wise min.
Definition SIMD.h:1813
uint32_t WriteIndex
Definition AbstractIndex.h:90
Definition DelayLine.h:74
float Process(const DelayLine &delayLine)
Process delay crossfade and get the delayed sample.
Definition DelayLine.h:110
void SetDelay(float delay)
Definition DelayLine.h:89
void SetCrossfade(float alpha)
Definition DelayLine.h:81
static constexpr uint32_t InputLength
Definition DelayLine.h:75
Definition DelayLine.h:45
InterpolatorType Interpolator
Definition DelayLine.h:50
InterpolatorT InterpolatorType
Definition DelayLine.h:47
int DelaySample
Definition DelayLine.h:49
float Process(const DelayLine &delayLine)
Process delay interpolation and get the delayed sample.
Definition DelayLine.h:63
void SetDelay(float delay)
Set delay is in samples, can be fractional.
Definition DelayLine.h:53