|
arduino-audio-tools
|
Simple Chorus effect with a single delay voice and mono output Chorus is effective between 15 and 20 miliseconds delay of original audio. Requires the sample rate when initialising. More...
#include <AudioEffectsSuite.h>
Public Attributes | |
| int | sampleRate |
| effectsuite_t | tableIndex = 0 |
| effectsuite_t | timeStep |
| effectsuite_t * | waveTable |
Protected Member Functions | |
| void | allocateBufferMemory () |
| bool | allocateMemory () |
| bool | changeChebyICoefficients (effectsuite_t cutFreq, bool shelfType, effectsuite_t ripple, int poles) |
| void | clearMemory () |
| int16_t | clip (int32_t in, int16_t clipLimit=32767, int16_t resultLimit=32767) |
| generic clipping method | |
| void | copyParent (AudioEffect *copy) |
| void | delaySample (effectsuite_t inputSample) |
| effectsuite_t | getInterpolatedOut (effectsuite_t bufferIndex) |
| effectsuite_t | getInterpOut (effectsuite_t bufferIndex) |
| effectsuite_t | getModSignal () |
| effectsuite_t | getSplineOut (effectsuite_t bufferIndex, int freq) |
| void | incBufferIndex () |
| void | incDelayBuffReadIndex (effectsuite_t indexInc) |
| void | incDelayBuffWriteIndex () |
| effectsuite_t | rms (effectsuite_t sample) |
| bool | setDelayBuffer (int bufferSizeSamples) |
| void | setDelayBuffReadIndex (effectsuite_t index) |
| void | setRandLfo () |
| bool | setSimpleLpf (int order) |
| void | storeSample (effectsuite_t inputSample) |
Static Protected Member Functions | |
| static effectsuite_t ** | setInterpolationTable () |
Protected Attributes | |
| bool | active_flag = true |
| effectsuite_t | base |
| int | bufferIndex = 0 |
| effectsuite_t | currentDelayReadIndex = 0 |
| int | currentDelayWriteIndex = 0 |
| effectsuite_t * | delayBuffer = 0 |
| int | delayTimeSamples = 44100 |
| bool | error |
| int | filterOrder = 0 |
| effectsuite_t * | firBuffer = 0 |
| effectsuite_t * | firCoefficients = 0 |
| effectsuite_t * | firTemp = 0 |
| int | id_value = -1 |
| effectsuite_t * | iirBuffer = 0 |
| effectsuite_t * | iirCoefficients = 0 |
| effectsuite_t * | iirTemp = 0 |
| effectsuite_t | interpTable [order][res] |
| bool | is_noise = false |
| int | maxDelayBufferSize = 441000 |
| effectsuite_t | modMax = .5 |
| effectsuite_t | modMin = .5 |
| effectsuite_t | modNorm = 1 / (modMax - modMin) |
| const effectsuite_t | readSpeed = ((readNoise() + 1) * .5) * .0005 |
| effectsuite_t * | rmsBuffer = new effectsuite_t[rmsWindowSize] |
| int | rmsBufferIndex = 0 |
| const int | rmsWindowSize = 128 |
| int | samplingRate = 0 |
| effectsuite_t | swing |
Static Protected Attributes | |
| static const int | interpOrder = 4 |
| static const int | interpResolution = 1000 |
| static const int | order = 4 |
| static const int | res = 100 |
Simple Chorus effect with a single delay voice and mono output Chorus is effective between 15 and 20 miliseconds delay of original audio. Requires the sample rate when initialising.
|
inline |
Constructor: initialises the effect parameters Since the class inherits DelayEffectBase it must set a delay buffer size when initialisi.
|
default |
|
default |
|
inlineprotectedinherited |
will allocate memory to a buffer given the current filter order and set all values == 0.00
|
inlineprotectedinherited |
allocate memory to internal wave table based on sample rate
|
inlinevirtualinherited |
with the current filter coefficients this method filters a sample then stores it the sample Buffer and increments the index
| sampVal | is the sample to be processed |
|
inlineprotectedinherited |
set firCoefficients and iirCoefficients for required chebyshev type I filter sampleBuffer memory is also set @params cutFreq normalised cutoff frequency (0 < x < .5) @params shelfType bool filter shelf type, false = low pass, true = high pass @params ripple percentage ripple (<.2929) @params poles number of poles
|
inlineprotectedinherited |
checks internal memory storage of filter coeffcients and deletes if required
|
inlineprotectedinherited |
generic clipping method
|
inlineinherited |
clip wave table values with a tanh function. Effect change with a variable amp to control intensity.
| amp | amount to multiply signal before being fed through a tanh function |
|
inlineoverridevirtual |
Implements AudioEffect.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
store input sample into the delay buffer and increment currentDelayWriteIndex for tracking when to loop back to start of buffer
| inputSample | sample to be stored for delay (effectsuite_t) |
|
inlineinherited |
detect the envelop of an incoming signal
| sample | the incoming signal sample value |
|
inlineprotectedinherited |
get the value of the requested buffer index by interpolating other points
| bufferIndex | The required buffer index |
|
inlineprotectedinherited |
get the interpolated output of the waveTable from the given buffer index
| bufferIndex | buffer index as effectsuite_t |
|
inlineprotected |
modulation signal scaling equation: ((n - modMin)*modNorm*swing) + base modulates a random white noise signal by lowpass filtering then scaling to a range between 15 to 25 miliseconds of delay.
|
inlineprotectedinherited |
get a cubic spline interpolated out from the wave table
Derived from code by Alec Wright at repository: https://github.com/Alec-Wright/Chorus
| bufferIndex | the required buffer index |
| freq | (speed) that the table is being read through |
|
inlineinherited |
Allows to identify an effect.
|
inlineprotectedinherited |
increment the buffer index and wrap it to the filter order
|
inlineprotectedinherited |
Increments the currentDelayBufferReadIndex by indexInc
| indexInc | The amount to increment the delay buffer index |
|
inlineprotectedinherited |
Increments the currentDelayWriteBufferIndex by 1
|
inlineinherited |
|
inlineinherited |
|
inlineoverridevirtual |
apply chorus effect to audio sample
| inputSample | input audio sample |
Reimplemented from FilterEffectBase.
|
inlineinherited |
reads out white noise
|
inlineinherited |
Read through values in waveTable as a given frequency
| freq | read speed in Hz: essentially the number of samples jumped between reads |
|
inlineprotectedinherited |
root mean square of signal over a specific sample window
|
inline |
sets the 'base' of the chorus: the minimum delay in the signal.
| baseAmount | <baseAmount description#> |
|
inlineinherited |
changes the current Chebyshev type 1 coefficients without altering the filter order. This allows for use in an audio process thread as it avoids dynamic allocation of memory. Filter sample and coefficient buffers are unaltered for initialising a chebyshev type 1 filter
|
inlineinherited |
sets wavetable to DC one
Allocates memory for delay buffer and initialises all elements to 0
| bufferSizeSamples | the size of delay buffer to be used |
|
inlineprotectedinherited |
sets the currentDelayBufferReadIndex by indexInc (Currently no wrapping)
| index | the read index index required |
|
inlinestaticprotectedinherited |
Sets the internal lagrange interpolation table. Ideally it should be shared amongst all
|
inlineinherited |
populates the internal interpolation table
|
inlineinherited |
|
inlineinherited |
sets wavetable to one period of a sine wave oscillating between 0 and 1
|
inlineinherited |
set wave table to be a ramp from 0 to 1
|
inlineprotected |
|
inlineinherited |
sets wavetable to one period of a sawtooth wave
a simple normalised fir low pass filter @params order number of delay coefficients
|
inlineinherited |
sets wavetable to one period of a sine wave oscillating between -1 and 1
|
inlineinherited |
sets wavetable to one period of a square wave
|
inline |
set the 'swing' of the chorus: The amount intensity of vibrato in the delay signal
| swingAmount | <swingAmount description#> |
|
inlineinherited |
sets wavetable to one period of a triangle wave
|
inline |
set parameters and internal sample rate
| extSampleRate | external sample rate |
<Description#>
| bufferSizeSamples | <bufferSizeSamples description#> |
|
inlineinherited |
setup the class with a given sample rate. Basically reperforming the constructor
| extSampRate | External sample rate |
|
inlineprotectedinherited |
store input sample into the delay buffer
| inputSample | sample to be stored for delay (effectsuite_t) |
|
protected |
minimum delay in samples. Typically 10 milliseconds
|
protectedinherited |
current buffer index
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
buffer to stored audio buffer for delay effects
|
protectedinherited |
the delay time of signal in samples
|
protectedinherited |
internal class error boolean
|
protectedinherited |
order of delay filter including the zero delay coefficients
|
protectedinherited |
buffer to hold forward delay sample data
|
protectedinherited |
Numerator coefficients in delay filter firCoefficients[0] z^0 coeffcieint firCoefficients[1] z^-1 coefficient
|
protectedinherited |
hold temporary values for fir coeffcient buffer
|
protectedinherited |
|
protectedinherited |
buffer to hold backward delay sample data
|
protectedinherited |
Denomiator coefficients in delay filter
|
protectedinherited |
hold temporary values for iir coeffcient buffer
|
protectedinherited |
|
protectedinherited |
Maximum number of samples that can be stored in delayBuffer
|
protected |
the maximum value of the lowpassed random modulation signal
|
protected |
the minimum value of the lowpassed random modulation signal
|
protected |
the normalising factor of the random delay signal
|
protected |
|
protectedinherited |
RMS window buffer
|
protectedinherited |
current write index of rmsBuffer
|
inherited |
Internal Sample Rate
|
protectedinherited |
|
protected |
swing range of delayed audio index in samples typical maximum swing would be 15 milliseconds (i.e. 0.015*sampleRate)
|
inherited |
current table read index
|
inherited |
time between samples: 1/sampRate
|
inherited |
store modulation signal as