37 struct WindowedSincTraits
39 static constexpr float algorithmicLatency = 100.0f;
41 static forcedinline
float windowedSinc (
float firstFrac,
int index)
noexcept
46 auto value1 = lookupTable[index];
52 static forcedinline
float valueAtOffset (
const float*
const inputs,
const float offset,
int indexBuffer)
noexcept
58 auto samplePosition = indexBuffer;
61 int index = 0, sign = -1;
77 result += inputs[samplePosition];
79 result += inputs[samplePosition] * windowedSinc (
firstFrac, index);
91 static const float lookupTable[10001];
96 static constexpr float algorithmicLatency = 2.0f;
98 static float valueAtOffset (
const float*,
float,
int)
noexcept;
101 struct CatmullRomTraits
104 static constexpr float algorithmicLatency = 2.0f;
106 static forcedinline
float valueAtOffset (
const float*
const inputs,
const float offset,
int index)
noexcept
108 auto y0 = inputs[index];
if (++index == 4) index = 0;
109 auto y1 = inputs[index];
if (++index == 4) index = 0;
110 auto y2 = inputs[index];
if (++index == 4) index = 0;
111 auto y3 = inputs[index];
116 return y1 + offset * ((0.5f * y2 -
halfY0)
117 + (offset * (((
y0 + 2.0f * y2) - (
halfY3 + 2.5f * y1))
118 + (offset * ((
halfY3 + 1.5f * y1) - (
halfY0 + 1.5f * y2))))));
124 static constexpr float algorithmicLatency = 1.0f;
126 static forcedinline
float valueAtOffset (
const float*
const inputs,
const float offset,
int index)
noexcept
128 auto y0 = inputs[index];
129 auto y1 = inputs[index == 0 ? 1 : 0];
131 return y1 * offset +
y0 * (1.0f - offset);
135 struct ZeroOrderHoldTraits
137 static constexpr float algorithmicLatency = 0.0f;
139 static forcedinline
float valueAtOffset (
const float*
const inputs,
const float,
int)
noexcept