NAP
Public Member Functions | List of all members
Delay Class Reference

#include <audio/utility/delay.h>

Public Member Functions

 Delay (unsigned int bufferSize)
 
 ~Delay ()=default
 
void write (SampleValue sample)
 
SampleValue read (unsigned int time)
 
SampleValue readInterpolating (float sampleTime)
 
void clear ()
 
unsigned int getMaxDelay ()
 
SampleValue operator[] (unsigned int index)
 

Description

Utility class representing a single delay that can be written and read from. Supports interpolation between samples while reading.

Constructor & Destructor Documentation

◆ Delay()

Delay ( unsigned int  bufferSize)

The buffer size has to be a power of 2

◆ ~Delay()

~Delay ( )
default

Member Function Documentation

◆ clear()

void clear ( )

Clear the delay line by flushing its buffer.

◆ getMaxDelay()

unsigned int getMaxDelay ( )
Returns
: return the maximum delay. (equalling the size of the buffer)

◆ operator[]()

SampleValue operator[] ( unsigned int  index)

Operator to read from the delay line without interpolation at given index before the write position

◆ read()

SampleValue read ( unsigned int  time)

Read a sample from the delay line at given time samples behind the write position. Non interpolating.

◆ readInterpolating()

SampleValue readInterpolating ( float  sampleTime)

Same as read() but with interpolation between samples

◆ write()

void write ( SampleValue  sample)

Write a sample to the delay line at the current write position