Dual channel delay line abstraction with interleaved samples.
More...
#include <delayline.hpp>
|
| DualDelayLine (void) |
| Default constructor.
|
|
| DualDelayLine (f32pair_t *ram, size_t line_size) |
| Constructor with explicit memory area to use as backing buffer for delay line. More...
|
|
void | clear (void) |
| Zero clear the whole delay line.
|
|
void | setMemory (f32pair_t *ram, size_t line_size) |
| Set the memory area to use as backing buffer for the delay line. More...
|
|
void | write (const f32pair_t &p) |
| Write a sample pair to the delay line. More...
|
|
f32pair_t | read (const uint32_t pos) |
| Read a sample pair from the delay line at given position from current write index. More...
|
|
f32pair_t | readFrac (const float pos) |
| Read a sample pair from the delay line at a fractional position from current write index. More...
|
|
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 last read. More...
|
|
float | read0 (const uint32_t pos) |
| Read a single sample from the delay line's primary channel at given position from current write index. More...
|
|
float | read1 (const uint32_t pos) |
| Read a single sample from the delay line's secondary channel at given position from current write index. More...
|
|
float | read0Frac (const float pos) |
| Read a single sample from the delay line's primary channel at a fractional position from current write index. More...
|
|
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 with interpolation from last read. More...
|
|
float | read1Frac (const float pos) |
| Read a single sample from the delay line's secondary channel at a fractional position from current write index. More...
|
|
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 with interpolation from last read. More...
|
|
Dual channel delay line abstraction with interleaved samples.
Definition at line 187 of file delayline.hpp.
◆ DualDelayLine()
dsp::DualDelayLine::DualDelayLine |
( |
f32pair_t * |
ram, |
|
|
size_t |
line_size |
|
) |
| |
|
inline |
Constructor with explicit memory area to use as backing buffer for delay line.
- Parameters
-
ram | Pointer to memory buffer |
line_size | Size in float pairs of memory buffer |
Definition at line 215 of file delayline.hpp.
◆ read()
f32pair_t dsp::DualDelayLine::read |
( |
const uint32_t |
pos | ) |
|
|
inline |
Read a sample pair from the delay line at given position from current write index.
- Parameters
-
pos | Offset from write index |
- Returns
- Sample pair at given position from write index
Definition at line 266 of file delayline.hpp.
267 return mLine[(mWriteIdx + pos) & mMask];
◆ read0()
float dsp::DualDelayLine::read0 |
( |
const uint32_t |
pos | ) |
|
|
inline |
Read a single sample from the delay line's primary channel at given position from current write index.
- Parameters
-
pos | Offset from write index. |
- Returns
- Sample at given position from write index
Definition at line 308 of file delayline.hpp.
309 return (mLine[(mWriteIdx + pos) & mMask]).a;
◆ read0Frac()
float dsp::DualDelayLine::read0Frac |
( |
const float |
pos | ) |
|
|
inline |
Read a single sample from the delay line's primary channel at a fractional position from current write index.
- Parameters
-
pos | Offset from write index as floating point. |
- Returns
- Interpolated sample at given fractional position from write index
Definition at line 330 of file delayline.hpp.
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);
◆ read0Fracz()
float dsp::DualDelayLine::read0Fracz |
( |
const uint32_t |
pos, |
|
|
const float |
frac |
|
) |
| |
|
inline |
Read a single sample from the delay line's primary channel at a position from current write index with interpolation from last read.
- Parameters
-
pos | Offset from write index |
frac | Interpolation from last read pair. |
- Returns
- Interpolation of last read sample and sample at given position from write index.
Definition at line 346 of file delayline.hpp.
347 const float f0 =
read0(pos);
348 const float y =
linintf(frac, f0, mFracZ.a);
◆ read1()
float dsp::DualDelayLine::read1 |
( |
const uint32_t |
pos | ) |
|
|
inline |
Read a single sample from the delay line's secondary channel at given position from current write index.
- Parameters
-
pos | Offset from write index. |
- Returns
- Sample at given position from write index
Definition at line 319 of file delayline.hpp.
320 return (mLine[(mWriteIdx + pos) & mMask]).b;
◆ read1Frac()
float dsp::DualDelayLine::read1Frac |
( |
const float |
pos | ) |
|
|
inline |
Read a single sample from the delay line's secondary channel at a fractional position from current write index.
- Parameters
-
pos | Offset from write index as floating point. |
- Returns
- Interpolated sample at given fractional position from write index
Definition at line 360 of file delayline.hpp.
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);
◆ read1Fracz()
float dsp::DualDelayLine::read1Fracz |
( |
const uint32_t |
pos, |
|
|
const float |
frac |
|
) |
| |
|
inline |
Read a single sample from the delay line's secondary channel at a position from current write index with interpolation from last read.
- Parameters
-
pos | Offset from write index |
frac | Interpolation from last read pair. |
- Returns
- Interpolation of last read sample and sample at given position from write index.
Definition at line 376 of file delayline.hpp.
377 const float f0 =
read1(pos);
378 const float y =
linintf(frac, f0, mFracZ.b);
◆ readFrac()
f32pair_t dsp::DualDelayLine::readFrac |
( |
const float |
pos | ) |
|
|
inline |
Read a sample pair from the delay line at a fractional position from current write index.
- Parameters
-
pos | Offset from write index as floating point. |
- Returns
- Interpolated sample pair at given fractional position from write index
Definition at line 277 of file delayline.hpp.
278 const int32_t base = (uint32_t)pos;
279 const float frac = pos - base;
◆ readFracz()
f32pair_t dsp::DualDelayLine::readFracz |
( |
const uint32_t |
pos, |
|
|
const float |
frac |
|
) |
| |
|
inline |
Read a sample pair from the delay line at a position from current write index with interpolation from last read.
- Parameters
-
pos | Offset from write index |
frac | Interpolation from last read pair. |
- Returns
- Interpolation of last read sample pair and sample pair at given position from write index.
Definition at line 294 of file delayline.hpp.
◆ setMemory()
void dsp::DualDelayLine::setMemory |
( |
f32pair_t * |
ram, |
|
|
size_t |
line_size |
|
) |
| |
|
inline |
Set the memory area to use as backing buffer for the delay line.
- Parameters
-
ram | Pointer to memory buffer |
line_size | Size in float pairs of memory buffer |
- Note
- Will round size to next power of two.
Definition at line 242 of file delayline.hpp.
◆ write()
void dsp::DualDelayLine::write |
( |
const f32pair_t & |
p | ) |
|
|
inline |
Write a sample pair to the delay line.
- Parameters
-
p | Reference to float pair. |
Definition at line 255 of file delayline.hpp.
256 mLine[(mWriteIdx--) & mMask] = p;
The documentation for this struct was generated from the following file:
- /home/etienne/Documents/_projects/logue-sdk/logue-sdk-alt/platform/nutekt-digital/inc/dsp/delayline.hpp