Simple Delay effect consiting of a single tap delay with Effect Gain and feed back controls Constructor requires internal delay in samples.
More...
#include <AudioEffectsSuite.h>
|
| static effectsuite_t ** | interpolationTable = nullptr |
| | Table of interpolation values as a 2D array indexed by interpolationTable[pointIndex][alphaIndex]. One instance per DelayEffectBase<effectsuite_t> instantiation (previously a single namespace-scope global shared – and type-mismatched – across every effectsuite_t choice).
|
| |
| static const int | interpOrder = 4 |
| |
| static const int | interpResolution = 1000 |
| |
template<typename effectsuite_t = effectsuite_t_default>
class audio_tools::SimpleDelay< effectsuite_t >
Simple Delay effect consiting of a single tap delay with Effect Gain and feed back controls Constructor requires internal delay in samples.
- See also
- process
- Author
- Matthew Hamilton
- Copyright
- MIT License
◆ SimpleDelay() [1/2]
template<typename effectsuite_t = effectsuite_t_default>
| SimpleDelay |
( |
int |
maxDelayInSamples = 8810, |
|
|
int |
samplingRate = 44100 |
|
) |
| |
|
inline |
Constructor: DigitalEffect Base Must Be initialised
- Parameters
-
| delayInSamples | Set the amount of delay in samples |
- See also
- DelayEffectBase constructor
◆ SimpleDelay() [2/2]
template<typename effectsuite_t = effectsuite_t_default>
◆ ~SimpleDelay()
template<typename effectsuite_t = effectsuite_t_default>
◆ active()
determines if the effect is active
◆ capGain()
template<typename effectsuite_t = effectsuite_t_default>
| void capGain |
( |
effectsuite_t & |
gain | ) |
|
|
inlineprotected |
capGain: caps gain to a range of 1 and -1;
- Parameters
-
| gain | address of gain value |
◆ clip()
| int16_t clip |
( |
int32_t |
in, |
|
|
int16_t |
clipLimit = 32767, |
|
|
int16_t |
resultLimit = 32767 |
|
) |
| |
|
inlineprotectedinherited |
◆ clone()
template<typename effectsuite_t = effectsuite_t_default>
◆ copyParent()
◆ delaySample()
template<typename effectsuite_t = effectsuite_t_default>
| void delaySample |
( |
effectsuite_t |
inputSample | ) |
|
|
inlineprotectedinherited |
store input sample into the delay buffer and increment currentDelayWriteIndex for tracking when to loop back to start of buffer
- Parameters
-
| inputSample | sample to be stored for delay (effectsuite_t) |
◆ getInterpolatedOut()
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t getInterpolatedOut |
( |
effectsuite_t |
bufferIndex | ) |
|
|
inlineprotectedinherited |
get the value of the requested buffer index by interpolating other points
- Parameters
-
| bufferIndex | The required buffer index |
- Returns
- interpolated output
◆ getSplineOut()
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t getSplineOut |
( |
effectsuite_t |
bufferIndex | ) |
|
|
inlineprotected |
get a cubic spline interpolated out from the wave table Derived from code by Alec Wright at repository: https://github.com/Alec-Wright/Chorus
- Authors
- Matthew Hamilton, Alec Wright
- Parameters
-
| bufferIndex | the required buffer index |
- Returns
- returns interpolated value as effectsuite_t
◆ id()
Allows to identify an effect.
◆ incDelayBuffReadIndex()
template<typename effectsuite_t = effectsuite_t_default>
| void incDelayBuffReadIndex |
( |
effectsuite_t |
indexInc | ) |
|
|
inlineprotectedinherited |
Increments the currentDelayBufferReadIndex by indexInc
- Parameters
-
| indexInc | The amount to increment the delay buffer index |
◆ incDelayBuffWriteIndex()
template<typename effectsuite_t = effectsuite_t_default>
| void incDelayBuffWriteIndex |
( |
| ) |
|
|
inlineprotectedinherited |
Increments the currentDelayWriteBufferIndex by 1
◆ process()
template<typename effectsuite_t = effectsuite_t_default>
Main process block for applying audio effect
- Parameters
-
| inputSample | The int16_t input audio sample for the effect to be applied to |
- Returns
- an audio sample as a int16_t with effect applied
Reimplemented from EffectSuiteBase< effectsuite_t >.
◆ processFloat()
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t processFloat |
( |
effectsuite_t |
inputSample | ) |
|
|
inlineoverridevirtual |
Apply delay and return input sample along with delay buffer signal
- Parameters
-
| inputSample | <#inputSample description#> |
- Returns
- <#return value description#>
Implements EffectSuiteBase< effectsuite_t >.
◆ setActive()
| virtual void setActive |
( |
bool |
value | ) |
|
|
inlinevirtualinherited |
sets the effect active/inactive
◆ setDelayBuffer()
template<typename effectsuite_t = effectsuite_t_default>
| bool setDelayBuffer |
( |
int |
bufferSizeSamples | ) |
|
|
inlineprotectedinherited |
Allocates memory for delay buffer and initialises all elements to 0
- Parameters
-
| bufferSizeSamples | the 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()
template<typename effectsuite_t = effectsuite_t_default>
| void setDelayBuffReadIndex |
( |
effectsuite_t |
index | ) |
|
|
inlineprotectedinherited |
sets the currentDelayBufferReadIndex by indexInc (Currently no wrapping)
- Parameters
-
| index | the read index index required |
◆ setDelayGain()
template<typename effectsuite_t = effectsuite_t_default>
| void setDelayGain |
( |
effectsuite_t |
gain | ) |
|
|
inline |
setDelayGain: sets the delay gain to a value between 1 and -1
- Parameters
-
| gain | required delay gain. Values beyond 1 and -1 are capped to the maximum to avoid idiocy. Negative velus invoke a phase inversion. |
- See also
- setFeedbackGain
◆ setDelayTime()
template<typename effectsuite_t = effectsuite_t_default>
| void setDelayTime |
( |
effectsuite_t |
delayInSamples | ) |
|
|
inline |
<Description#>
- Parameters
-
| delayInSample | <#delayInSample description#> |
◆ setDelayTransitionTime()
template<typename effectsuite_t = effectsuite_t_default>
| void setDelayTransitionTime |
( |
effectsuite_t |
seconds | ) |
|
|
inline |
<Description#>
- Parameters
-
| seconds | <#seconds description#> |
◆ setFeedbackGain()
template<typename effectsuite_t = effectsuite_t_default>
| void setFeedbackGain |
( |
effectsuite_t |
gain | ) |
|
|
inline |
setDelayGain: sets the feedback gain to a value between 1 and -1
- Parameters
-
| gain | required delay gain. Values beyond 1 and -1 are capped to the maximum to avoid idiocy. Negative velus invoke a phase inversion. |
- See also
- setDelayGain
◆ setId()
Allows to identify an effect.
◆ setInterpolationTable()
template<typename effectsuite_t = effectsuite_t_default>
| static effectsuite_t ** setInterpolationTable |
( |
| ) |
|
|
inlinestaticprotectedinherited |
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()
template<typename effectsuite_t = effectsuite_t_default>
| void setupDelayEffectBase |
( |
const int |
bufferSizeSamples | ) |
|
|
inlineinherited |
<Description#>
- Parameters
-
| bufferSizeSamples | <#bufferSizeSamples description#> |
◆ setupSimpleDelay()
template<typename effectsuite_t = effectsuite_t_default>
| void setupSimpleDelay |
( |
int |
delayInSamples | ) |
|
|
inline |
<Description#>
- Parameters
-
| delayInSamples | <#delayInSamples description#> |
◆ storeSample()
template<typename effectsuite_t = effectsuite_t_default>
| void storeSample |
( |
effectsuite_t |
inputSample | ) |
|
|
inlineprotectedinherited |
store input sample into the delay buffer
- Parameters
-
| inputSample | sample to be stored for delay (effectsuite_t) |
◆ active_flag
◆ count
template<typename effectsuite_t = effectsuite_t_default>
◆ currentDelayReadIndex
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t currentDelayReadIndex = 0 |
|
protectedinherited |
◆ currentDelaySamples
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t currentDelaySamples |
|
protected |
◆ currentDelayWriteIndex
template<typename effectsuite_t = effectsuite_t_default>
| int currentDelayWriteIndex = 0 |
|
protectedinherited |
◆ delayBuffer
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t* delayBuffer = 0 |
|
protectedinherited |
buffer to stored audio buffer for delay effects
◆ delayGain
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t delayGain = .707 |
|
protected |
◆ delayIncrement
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t delayIncrement |
|
protected |
increment when transition from current to target delay per sample set by delayTransitionTime
◆ delayTimeChanged
template<typename effectsuite_t = effectsuite_t_default>
| bool delayTimeChanged = false |
|
protected |
◆ delayTimeSamples
template<typename effectsuite_t = effectsuite_t_default>
| int delayTimeSamples = 44100 |
|
protectedinherited |
the delay time of signal in samples
◆ delayTransitionTime
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t delayTransitionTime |
|
protected |
time in seconds to transition from one delay to another
◆ delayTransitionTimeInSamples
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t delayTransitionTimeInSamples |
|
protected |
◆ error
template<typename effectsuite_t = effectsuite_t_default>
internal class error boolean
◆ feedbackGain
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t feedbackGain = 0. |
|
protected |
◆ id_value
◆ interpolationTable
template<typename effectsuite_t >
| effectsuite_t ** interpolationTable = nullptr |
|
staticprotectedinherited |
Table of interpolation values as a 2D array indexed by interpolationTable[pointIndex][alphaIndex]. One instance per DelayEffectBase<effectsuite_t> instantiation (previously a single namespace-scope global shared – and type-mismatched – across every effectsuite_t choice).
◆ interpOrder
template<typename effectsuite_t = effectsuite_t_default>
| const int interpOrder = 4 |
|
staticprotectedinherited |
◆ interpResolution
template<typename effectsuite_t = effectsuite_t_default>
| const int interpResolution = 1000 |
|
staticprotectedinherited |
◆ invDelayIncrement
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t invDelayIncrement |
|
protected |
inverse of delay increment: for working out whole number cyles to reach target delay
◆ maxDelayBufferSize
template<typename effectsuite_t = effectsuite_t_default>
| int maxDelayBufferSize = 441000 |
|
protectedinherited |
Maximum number of samples that can be stored in delayBuffer
◆ readHeadIndex
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t readHeadIndex |
|
protected |
◆ sampleRate
template<typename effectsuite_t = effectsuite_t_default>
◆ targetDelaySamples
template<typename effectsuite_t = effectsuite_t_default>
| effectsuite_t targetDelaySamples |
|
protected |
◆ writeHeadIndex
template<typename effectsuite_t = effectsuite_t_default>
| unsigned int writeHeadIndex |
|
protected |
The documentation for this class was generated from the following file: