template<FloatType T, size_t N>
class marvin::containers::FixedCircularBuffer< T, N >
A simple fixed length circular buffer.
Very similar functionally to marvin::dsp::DelayLine
, but with a fixed length, and no interpolation. Useful for a situation where you just need a KISS circular buffer. 99% of the time, for a delay effect, you're much better off using marvin::dsp::DelayLine
instead.
Usage Example:
using namespace marvin::literals;
constexpr static auto size{ 1024 };
constexpr static auto delay{ 4 };
std::vector<float> impulse(size, 0.0f);
impulse.front() = 1.0f;
std::vector<float> delayBuffer{};
for(auto i = 0_sz; i < size; ++i) {
const auto delayed = circularBuffer.peek(delay);
circularBuffer.push(impulse[i]);
delayBuffer.emplace_back(delayed);
}
assert(delayBuffer[delay] == 1.0f);
FixedCircularBuffer()
Definition marvin_FixedCircularBuffer.h:44