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

Simple Flanger Effect Consistig of a single voice flanger The flanger has an effective range between 0 and 15 miliseconds in this case dleay buffer should be set to sampleRate*3/200 Constructor requires internal delay in samples. More...

#include <AudioEffectsSuite.h>

Inheritance diagram for audio_tools::SimpleFlanger:
audio_tools::DelayEffectBase audio_tools::EffectSuiteBase audio_tools::AudioEffect

Public Member Functions

 SimpleFlanger ()=default
 
 SimpleFlanger (effectsuite_t extSampleRate=44100)
 
 SimpleFlanger (SimpleFlanger &copy)=default
 
 ~SimpleFlanger ()=default
 
SimpleFlangerclone () override
 
effectsuite_t processDouble (effectsuite_t inputSample) override
 
void setDepth (const effectsuite_t depth)
 
void setEffectGain (effectsuite_t gain)
 
void setEffectParams (effectsuite_t gain, effectsuite_t depth, effectsuite_t rate)
 
void setRate (const effectsuite_t rate)
 
void setupSimpleFlanger (effectsuite_t extSampleRate)
 
- Public Member Functions inherited from audio_tools::DelayEffectBase
 DelayEffectBase ()=default
 
 DelayEffectBase (DelayEffectBase &copy)=default
 
 DelayEffectBase (int bufferSizeSamples)
 
 ~DelayEffectBase ()
 
void setupDelayEffectBase (const int bufferSizeSamples)
 
- Public Member Functions inherited from audio_tools::AudioEffect
virtual bool active ()
 determines if the effect is active
 
virtual AudioEffectclone ()=0
 
int id ()
 Allows to identify an effect.
 
virtual effect_t process (effect_t in)=0
 calculates the effect output from the input More...
 
virtual void setActive (bool value)
 sets the effect active/inactive
 
void setId (int id)
 Allows to identify an effect.
 

Protected Member Functions

effectsuite_t capGain (effectsuite_t gain)
 
void setAngleDelta ()
 
void updateModulation ()
 
- Protected Member Functions inherited from audio_tools::DelayEffectBase
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)
 
- Protected Member Functions inherited from audio_tools::AudioEffect
int16_t clip (int32_t in, int16_t clipLimit=32767, int16_t resultLimit=32767)
 generic clipping method
 
void copyParent (AudioEffect *copy)
 

Protected Attributes

effectsuite_t angleDelta = 2 * internal_Pi * timeStep
 
effectsuite_t effectGain = .01
 
effectsuite_t modulationAngle = 0
 
effectsuite_t modulationConstant
 
effectsuite_t modulationDepth = 1000
 
effectsuite_t modulationIndex = 0
 
effectsuite_t modulationRate = 0
 
effectsuite_t timeStep = 1. / 44100.
 
- Protected Attributes inherited from audio_tools::DelayEffectBase
effectsuite_t currentDelayReadIndex = 0
 
int currentDelayWriteIndex = 0
 
effectsuite_t * delayBuffer = 0
 
int delayTimeSamples = 44100
 
bool error
 
int maxDelayBufferSize = 441000
 
- Protected Attributes inherited from audio_tools::AudioEffect
bool active_flag = true
 
int id_value = -1
 

Static Protected Attributes

static constexpr const effectsuite_t internal_Pi = 3.141592653589793
 
- Static Protected Attributes inherited from audio_tools::DelayEffectBase
static const int interpOrder = 4
 
static const int interpResolution = 1000
 

Additional Inherited Members

- Static Protected Member Functions inherited from audio_tools::DelayEffectBase
static effectsuite_t ** setInterpolationTable ()
 

Detailed Description

Simple Flanger Effect Consistig of a single voice flanger The flanger has an effective range between 0 and 15 miliseconds in this case dleay buffer should be set to sampleRate*3/200 Constructor requires internal delay in samples.

See also
process
Author
Matthew Hamilton

Constructor & Destructor Documentation

◆ SimpleFlanger()

audio_tools::SimpleFlanger::SimpleFlanger ( )
default

Constructor: DigitalEffect Base Must Be initialised

See also
DelayEffectBase constructor

◆ ~SimpleFlanger()

audio_tools::SimpleFlanger::~SimpleFlanger ( )
default

Destructor.

Member Function Documentation

◆ capGain()

effectsuite_t audio_tools::SimpleFlanger::capGain ( effectsuite_t  gain)
inlineprotected

capGain: caps gain to a range of 1 and -1;

Parameters
gainaddress of gain value

◆ clone()

SimpleFlanger * audio_tools::SimpleFlanger::clone ( )
inlineoverridevirtual

◆ processDouble()

effectsuite_t audio_tools::SimpleFlanger::processDouble ( effectsuite_t  inputSample)
inlineoverridevirtual

Apply the DSP effect

Implements audio_tools::EffectSuiteBase.

◆ setAngleDelta()

void audio_tools::SimpleFlanger::setAngleDelta ( )
inlineprotected

setAngleDelta: sets the angleDelta for delay modulation

◆ setDepth()

void audio_tools::SimpleFlanger::setDepth ( const effectsuite_t  depth)
inline

<Description#>

Parameters
depth<#depth description#>

◆ setEffectGain()

void audio_tools::SimpleFlanger::setEffectGain ( effectsuite_t  gain)
inline

setEffectGain: sets the effect gain to a value between 1 and -1

Parameters
gainrequired delay gain. Values beyond 1 and -1 are capped to the maximum to avoid idiocy. Negative velus invoke a phase inversion.

◆ setEffectParams()

void audio_tools::SimpleFlanger::setEffectParams ( effectsuite_t  gain,
effectsuite_t  depth,
effectsuite_t  rate 
)
inline

setEffectGain: sets the parameters for effect

Parameters
gaineffect gain
depthdepth of modulation in samples
raterate of modulation in Hz

◆ setRate()

void audio_tools::SimpleFlanger::setRate ( const effectsuite_t  rate)
inline

<Description#>

Parameters
rate<#rate description#>

◆ updateModulation()

void audio_tools::SimpleFlanger::updateModulation ( )
inlineprotected

updateModulation: updates the modulationIndex by the correct increment

Member Data Documentation

◆ angleDelta

effectsuite_t audio_tools::SimpleFlanger::angleDelta = 2 * internal_Pi * timeStep
protected

increment value for modulation signal

◆ internal_Pi

constexpr const effectsuite_t audio_tools::SimpleFlanger::internal_Pi = 3.141592653589793
staticconstexprprotected

internal class declaration of pi it would likely make sense to have this moved to a higher class

◆ modulationConstant

effectsuite_t audio_tools::SimpleFlanger::modulationConstant
protected

2 * pi * modulationRate / sampleRate

◆ timeStep

effectsuite_t audio_tools::SimpleFlanger::timeStep = 1. / 44100.
protected

1/sampleRate: The time in seconds between samples


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