1 #ifndef _InterpolatingCircularBuffer_hpp_
2 #define _InterpolatingCircularBuffer_hpp_
8 template<InterpolationMethod im = LINEAR_INTERPOLATION>
35 void read(
float* out,
size_t len,
float startpos,
float rate){
66 void delay(
float* in,
float* out,
size_t len,
float readDelay){
68 delay(out, len, readDelay + len);
75 void delay(
float* out,
size_t len,
float beginDelay,
float endDelay){
78 float incr = (len+endDelay-beginDelay)/len;
93 void delay(
float* in,
float* out,
size_t len,
float beginDelay,
float endDelay){
95 delay(out, len, beginDelay + len, endDelay + len);
112 size_t idx = (size_t)roundf(index);
118 size_t idx = (size_t)index;
121 float frac = index - idx;
127 size_t idx = (size_t)index;
130 float frac = index - idx;
131 writeAt(idx, low + (value-low)*frac);
132 writeAt(idx+1, value + (high-value)*frac);
137 size_t idx = (size_t)index;
140 float frac = index - idx;
146 size_t idx = (size_t)index;
155 size_t idx = (size_t)index;
165 size_t idx = (size_t)index;
175 size_t idx = (size_t)index;
float readAt(size_t index)
static void destroy(InterpolatingCircularFloatBuffer< im > *obj)
void delay(float *in, float *out, size_t len, float beginDelay, float endDelay)
Write to buffer and read with a delay that ramps up or down from.
float getFractionalDelay()
static InterpolatingCircularFloatBuffer< im > * create(size_t len)
void delay(float *out, size_t len, float beginDelay, float endDelay)
Read with a delay that ramps up or down from.
void writeAt(float index, float value)
Interpolated write at sub-sample index.
void delay(float *in, float *out, size_t len, float readDelay)
Write to buffer and read with a fractional delay.
void delay(float *out, size_t len, float delay)
Read with a fractional delay.
void read(float *out, size_t len, float startpos, float rate)
Interpolated read at fractional rate.
float readAt(float index)
Interpolated read at sub-sample index.
InterpolatingCircularFloatBuffer(float *data, size_t size)
InterpolatingCircularFloatBuffer()
static float cubic(float y0, float y1, float y2, float mu)
Three-point cubic interpolation of point between y1 and y2 ref: http://www.ebyte.it/library/codesnipp...
static float hermite(float y0, float y1, float y2, float y3, float mu, float tension=0, float bias=0)
static float linear(float y1, float y2, float mu)
static float cosine(float y1, float y2, float mu)
static float cubicSmooth(float y0, float y1, float y2, float y3, float mu)