arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
audio_tools::DelayEffectBase Class Reference

A Base class for delay based digital effects. Provides the basic methods that are shared amongst Flanger, Delay, Chorus and Phaser. More...

#include <AudioEffectsSuite.h>

Inheritance diagram for audio_tools::DelayEffectBase:
audio_tools::FilteredDelay audio_tools::SimpleChorus audio_tools::SimpleDelay audio_tools::SimpleFlanger

Public Member Functions

 DelayEffectBase ()=default
 
 DelayEffectBase (DelayEffectBase &copy)=default
 
 DelayEffectBase (int bufferSizeSamples)
 
 ~DelayEffectBase ()
 
void setupDelayEffectBase (const int bufferSizeSamples)
 

Protected Member Functions

void delaySample (effectsuite_t inputSample)
 
effectsuite_t getInterpolatedOut (effectsuite_t bufferIndex)
 
void incDelayBuffReadIndex (effectsuite_t indexInc)
 
void incDelayBuffWriteIndex ()
 
void printInterpTable ()
 
bool setDelayBuffer (int bufferSizeSamples)
 
void setDelayBuffReadIndex (effectsuite_t index)
 
void storeSample (effectsuite_t inputSample)
 

Static Protected Member Functions

static effectsuite_t ** setInterpolationTable ()
 

Protected Attributes

effectsuite_t currentDelayReadIndex = 0
 
int currentDelayWriteIndex = 0
 
effectsuite_t * delayBuffer = 0
 
int delayTimeSamples = 44100
 
bool error
 
int maxDelayBufferSize = 441000
 

Static Protected Attributes

static const int interpOrder = 4
 
static const int interpResolution = 1000
 

Detailed Description

A Base class for delay based digital effects. Provides the basic methods that are shared amongst Flanger, Delay, Chorus and Phaser.

Version
0.1
See also
DelayEffectBase
Author
Matthew Hamilton

Constructor & Destructor Documentation

◆ DelayEffectBase()

audio_tools::DelayEffectBase::DelayEffectBase ( )
default

Constructor.

◆ ~DelayEffectBase()

audio_tools::DelayEffectBase::~DelayEffectBase ( )
inline

Destructor.

Member Function Documentation

◆ delaySample()

void audio_tools::DelayEffectBase::delaySample ( effectsuite_t  inputSample)
inlineprotected

store input sample into the delay buffer and increment currentDelayWriteIndex for tracking when to loop back to start of buffer

Parameters
inputSamplesample to be stored for delay (effectsuite_t)

◆ getInterpolatedOut()

effectsuite_t audio_tools::DelayEffectBase::getInterpolatedOut ( effectsuite_t  bufferIndex)
inlineprotected

get the value of the requested buffer index by interpolating other points

Parameters
bufferIndexThe required buffer index
Returns
interpolated output

◆ incDelayBuffReadIndex()

void audio_tools::DelayEffectBase::incDelayBuffReadIndex ( effectsuite_t  indexInc)
inlineprotected

Increments the currentDelayBufferReadIndex by indexInc

Parameters
indexIncThe amount to increment the delay buffer index

◆ incDelayBuffWriteIndex()

void audio_tools::DelayEffectBase::incDelayBuffWriteIndex ( )
inlineprotected

Increments the currentDelayWriteBufferIndex by 1

◆ setDelayBuffer()

bool audio_tools::DelayEffectBase::setDelayBuffer ( int  bufferSizeSamples)
inlineprotected

Allocates memory for delay buffer and initialises all elements to 0

Parameters
bufferSizeSamplesthe size of delay buffer to be used
Returns
false and error description if there's a problem, or sets the internal delay buffer and returns true

◆ setDelayBuffReadIndex()

void audio_tools::DelayEffectBase::setDelayBuffReadIndex ( effectsuite_t  index)
inlineprotected

sets the currentDelayBufferReadIndex by indexInc (Currently no wrapping)

Parameters
indexthe read index index required

◆ setInterpolationTable()

static effectsuite_t ** audio_tools::DelayEffectBase::setInterpolationTable ( )
inlinestaticprotected

Sets the internal lagrange interpolation table. Ideally it should be shared amongst all

Returns
false and an error description if there's a problem, or sets the interpolation lookup table and returns true

◆ setupDelayEffectBase()

void audio_tools::DelayEffectBase::setupDelayEffectBase ( const int  bufferSizeSamples)
inline

<Description#>

Parameters
bufferSizeSamples<#bufferSizeSamples description#>

◆ storeSample()

void audio_tools::DelayEffectBase::storeSample ( effectsuite_t  inputSample)
inlineprotected

store input sample into the delay buffer

Parameters
inputSamplesample to be stored for delay (effectsuite_t)

Member Data Documentation

◆ delayBuffer

effectsuite_t* audio_tools::DelayEffectBase::delayBuffer = 0
protected

buffer to stored audio buffer for delay effects

◆ delayTimeSamples

int audio_tools::DelayEffectBase::delayTimeSamples = 44100
protected

the delay time of signal in samples

◆ error

bool audio_tools::DelayEffectBase::error
protected

internal class error boolean

◆ maxDelayBufferSize

int audio_tools::DelayEffectBase::maxDelayBufferSize = 441000
protected

Maximum number of samples that can be stored in delayBuffer


The documentation for this class was generated from the following file: