Nu:Tekt NTS-1 digital SDK
v1.1-0
|
Go to the documentation of this file.
99 inline __attribute__((optimize(
"Ofast"),always_inline))
112 inline __attribute__((optimize(
"Ofast"),always_inline))
125 inline __attribute__((optimize(
"Ofast"),always_inline))
127 mLine[(mWriteIdx--) & mMask] = s;
136 inline __attribute__((optimize(
"Ofast"),always_inline))
137 float
read(const uint32_t pos) {
138 return mLine[(mWriteIdx + pos) & mMask];
147 inline __attribute__((optimize(
"Ofast"),always_inline))
149 const uint32_t base = (uint32_t)pos;
150 const float frac = pos - base;
151 const float s0 =
read(base);
152 const float s1 =
read(base+1);
163 inline __attribute__((optimize(
"Ofast"),always_inline))
165 const float s0 =
read(pos);
166 const float y =
linintf(frac, s0, mFracZ);
228 inline __attribute__((optimize(
"Ofast"),always_inline))
241 inline __attribute__((optimize(
"Ofast"),always_inline))
254 inline __attribute__((optimize(
"Ofast"),always_inline))
256 mLine[(mWriteIdx--) & mMask] = p;
265 inline __attribute__((optimize(
"Ofast"),always_inline))
267 return mLine[(mWriteIdx + pos) & mMask];
276 inline __attribute__((optimize(
"Ofast"),always_inline))
278 const int32_t base = (uint32_t)pos;
279 const float frac = pos - base;
293 inline __attribute__((optimize(
"Ofast"),always_inline))
307 inline __attribute__((optimize(
"Ofast"),always_inline))
309 return (mLine[(mWriteIdx + pos) & mMask]).a;
318 inline __attribute__((optimize(
"Ofast"),always_inline))
320 return (mLine[(mWriteIdx + pos) & mMask]).b;
329 inline __attribute__((optimize(
"Ofast"),always_inline))
331 const int32_t base = (uint32_t)pos;
332 const float frac = pos - base;
333 const float f0 =
read0(base);
334 const float f1 =
read0(base+1);
345 inline __attribute__((optimize(
"Ofast"),always_inline))
347 const float f0 =
read0(pos);
348 const float y =
linintf(frac, f0, mFracZ.a);
359 inline __attribute__((optimize(
"Ofast"),always_inline))
361 const int32_t base = (uint32_t)pos;
362 const float frac = pos - base;
363 const float f0 =
read1(base);
364 const float f1 =
read1(base+1);
375 inline __attribute__((optimize(
"Ofast"),always_inline))
377 const float f0 =
read1(pos);
378 const float y =
linintf(frac, f0, mFracZ.b);
static f32pair_t f32pair_linint(const float fr, const f32pair_t p0, const f32pair_t p1)
Pair-wise linear interpolation.
void write(const f32pair_t &p)
Write a sample pair to the delay line.
void clear(void)
Zero clear the whole delay line.
DualDelayLine(f32pair_t *ram, size_t line_size)
Constructor with explicit memory area to use as backing buffer for delay line.
float read1(const uint32_t pos)
Read a single sample from the delay line's secondary channel at given position from current write ind...
void clear(void)
Zero clear the whole delay line.
Floating Point Math Utilities.
float readFracz(const uint32_t pos, const float frac)
Read a sample from the delay line at a position from current write index with interpolation from last...
void write(const float s)
Write a single sample to the head of the delay line.
Basic delay line abstraction.
DualDelayLine(void)
Default constructor.
float read0Frac(const float pos)
Read a single sample from the delay line's primary channel at a fractional position from current writ...
float readFrac(const float pos)
Read a sample from the delay line at a fractional position from current write index.
Operations over data buffers.
f32pair_t read(const uint32_t pos)
Read a sample pair from the delay line at given position from current write index.
float read1Fracz(const uint32_t pos, const float frac)
Read a single sample from the delay line's secondary channel at a position from current write index w...
static void buf_clr_f32(float *__restrict__ ptr, const uint32_t len)
Buffer clear (float version)
f32pair_t readFracz(const uint32_t pos, const float frac)
Read a sample pair from the delay line at a position from current write index with interpolation from...
float read0Fracz(const uint32_t pos, const float frac)
Read a single sample from the delay line's primary channel at a position from current write index wit...
static uint32_t nextpow2_u32(uint32_t x)
Compute next power of 2 greater than x.
Dual channel delay line abstraction with interleaved samples.
void setMemory(float *ram, size_t line_size)
Set the memory area to use as backing buffer for the delay line.
float read(const uint32_t pos)
Read a single sample from the delay line at given position from current write index.
DelayLine(float *ram, size_t line_size)
Constructor with explicit memory area to use as backing buffer for delay line.
DelayLine(void)
Default constructor.
float read1Frac(const float pos)
Read a single sample from the delay line's secondary channel at a fractional position from current wr...
static float linintf(const float fr, const float x0, const float x1)
Linear interpolation.
void setMemory(f32pair_t *ram, size_t line_size)
Set the memory area to use as backing buffer for the delay line.
float read0(const uint32_t pos)
Read a single sample from the delay line's primary channel at given position from current write index...
f32pair_t readFrac(const float pos)
Read a sample pair from the delay line at a fractional position from current write index.