arduino-audio-tools
|
Compressor inspired by https://github.com/YetAnotherElectronicsChannel/STM32_DSP_COMPRESSOR/blob/master/code/Src/main.c. More...
#include <AudioEffect.h>
Public Member Functions | |
Compressor (const Compressor ©)=default | |
Copy Constructor. | |
Compressor (uint32_t sampleRate=44100, uint16_t attackMs=30, uint16_t releaseMs=20, uint16_t holdMs=10, uint8_t thresholdPercent=10, float compressionRatio=0.5) | |
Default Constructor. | |
virtual bool | active () |
determines if the effect is active | |
Compressor * | clone () |
int | id () |
Allows to identify an effect. | |
effect_t | process (effect_t input) |
Processes the sample. | |
virtual void | setActive (bool value) |
sets the effect active/inactive | |
void | setAttack (uint16_t attackMs) |
Defines the attack duration in ms. | |
void | setCompressionRatio (float compressionRatio) |
Defines the compression ratio from 0 to 1. | |
void | setHold (uint16_t holdMs) |
Defines the hold duration in ms. | |
void | setId (int id) |
Allows to identify an effect. | |
void | setRelease (uint16_t releaseMs) |
Defines the release duration in ms. | |
void | setThresholdPercent (uint8_t thresholdPercent) |
Defines the threshod in %. | |
Protected Types | |
enum | CompStates { S_NoOperation , S_Attack , S_GainReduction , S_Release } |
Protected Member Functions | |
int16_t | clip (int32_t in, int16_t clipLimit=32767, int16_t resultLimit=32767) |
generic clipping method | |
float | compress (float inSampleF) |
void | copyParent (AudioEffect *copy) |
void | recalculate () |
Compressor inspired by https://github.com/YetAnotherElectronicsChannel/STM32_DSP_COMPRESSOR/blob/master/code/Src/main.c.