![]() |
:)
|
Dynamic level compression DSP unit. More...
#include <RustyCompressor.hpp>
Public Member Functions | |
| RustyCompressor (float threshold, float knee, float ratio, float attack, float release, float makeupGain) | |
| Constructor for RustyCompressor. | |
| void | process (float *sample) override |
| Performs DSP on an audio sample. | |
| void | setModulatorForParameter (std::string parameter, RustyModulator *modulator) override |
| Binds a RustyModulator to a RustyProcessor instance parameter. | |
| void | setParameter (std::string parameter, std::string value) override |
| Sets RustyProcessor parameter to new value. | |
| virtual std::string | getProcessorType () override |
| Function to get processor type. | |
| virtual std::string | getParams () override |
| Function to get processor params. | |
Public Member Functions inherited from RustyProcessor | |
| virtual void | process (float *sample)=0 |
| Performs DSP on an audio sample. | |
| virtual void | setModulatorForParameter (std::string parameter, RustyModulator *modulator)=0 |
| Binds a RustyModulator to a RustyProcessor instance parameter. | |
| virtual void | setParameter (std::string parameter, std::string value)=0 |
| Sets RustyProcessor parameter to new value. | |
| bool | isNumeric (const std::string &str) |
| Function to test if value contains numeric characters. | |
| virtual std::string | getProcessorType ()=0 |
| Function to get processor type. | |
| virtual std::string | getParams ()=0 |
| Function to get processor params. | |
Private Attributes | |
| RustyRingBuffer | _lookAheadBuffer {32} |
| float | _threshold |
| Compression threshold. | |
| float | _kneeWidth = 4 |
| Compression knee. | |
| float | _ratio |
| Compression reduction ratio. | |
| float | _attack |
| Compressor attack speed. | |
| float | _release |
| Compressor release speed. | |
| float | _makeupGain |
| Gain makeup variable. | |
| float | x_g |
| dB input sample | |
| float | y_g |
| Gain Computation output. | |
| float | x_l |
| Gain computation post sum. | |
| float | y_l_dB |
| Gain reduction with smoothing in dB. | |
| float | y_l |
| Gain reduction with smoothing in linear value. | |
| float | y_l_prev = 0.001 |
| Previous compressor sidechain output. | |
| float | cv = 0 |
| Compressor multiplier. | |
| float * | read_ptr = new float |
| Read pointer for RingBuffer. | |
Additional Inherited Members | |
Public Attributes inherited from RustyProcessor | |
| std::map< std::string, RustyModulator * > | _modulators |
| Map of processors affecting derived RustyProcessor. | |
Dynamic level compression DSP unit.
Log-domain feedback compressor, that is able to dynamically reduce audio signals.
Inherited from RustyProcessor.
Definition at line 23 of file RustyCompressor.hpp.
| RustyCompressor::RustyCompressor | ( | float | threshold, |
| float | knee, | ||
| float | ratio, | ||
| float | attack, | ||
| float | release, | ||
| float | makeupGain | ||
| ) |
Constructor for RustyCompressor.
Takes initial parameters for RustyCompressor and preps the compressor for sample processing.
| threshold | Float of threshold in dB. |
| knee | Float of knee curve in dB. |
| ratio | Float of compression ratio. |
| attack | Float of attack speed in Ms. |
| release | Float of release speed in ms. |
| makeupGain | Float of gain makeup in dB. |
Definition at line 3 of file RustyCompressor.cpp.
|
overridevirtual |
Performs DSP on an audio sample.
This pure virtual function performs DSP algorithms on a sample by sample basis. A pointer to a 32bitFloat audio sample is passed as an argument and this will be the value used as the input to the DSP function f(x).
| sample | Pointer to a 32bitFloat audio sample value. |
Implements RustyProcessor.
Definition at line 12 of file RustyCompressor.cpp.
|
overridevirtual |
Binds a RustyModulator to a RustyProcessor instance parameter.
This is pure virtual function assigns modulator manipulation to parameters within the DSP unit. Each RustyProcessor derived DSP unit will check the parameter name against suitable parameters, if there is a match the modulator will affect the parameter.
| parameter | String of the parameter to affect. |
| modulator | Pointer to instance of RustyModulator. |
Implements RustyProcessor.
Definition at line 61 of file RustyCompressor.cpp.
|
overridevirtual |
Sets RustyProcessor parameter to new value.
This is pure virtual function that assigns a new value to a parameter of RustyProcessor derived DSP units. This function is used at runtime from CLI interaction.
| parameter | String of the parameter to affect. |
| modulator | Pointer to instance of RustyModulator. |
Implements RustyProcessor.
Definition at line 72 of file RustyCompressor.cpp.
|
overridevirtual |
Function to get processor type.
Simple function allows CLI to test Processor types for user interaction.
Implements RustyProcessor.
Definition at line 152 of file RustyCompressor.cpp.
|
overridevirtual |
Function to get processor params.
Simple function allows CLI to get available params for RustyProcessor child.
Implements RustyProcessor.
Definition at line 157 of file RustyCompressor.cpp.
|
private |
Definition at line 51 of file RustyCompressor.hpp.
|
private |
Compression threshold.
Definition at line 53 of file RustyCompressor.hpp.
|
private |
Compression knee.
Definition at line 54 of file RustyCompressor.hpp.
|
private |
Compression reduction ratio.
Definition at line 55 of file RustyCompressor.hpp.
|
private |
Compressor attack speed.
Definition at line 56 of file RustyCompressor.hpp.
|
private |
Compressor release speed.
Definition at line 57 of file RustyCompressor.hpp.
|
private |
Gain makeup variable.
Definition at line 58 of file RustyCompressor.hpp.
|
private |
dB input sample
Definition at line 60 of file RustyCompressor.hpp.
|
private |
Gain Computation output.
Definition at line 61 of file RustyCompressor.hpp.
|
private |
Gain computation post sum.
Definition at line 62 of file RustyCompressor.hpp.
|
private |
Gain reduction with smoothing in dB.
Definition at line 63 of file RustyCompressor.hpp.
|
private |
Gain reduction with smoothing in linear value.
Definition at line 64 of file RustyCompressor.hpp.
|
private |
Previous compressor sidechain output.
Definition at line 65 of file RustyCompressor.hpp.
|
private |
Compressor multiplier.
Definition at line 66 of file RustyCompressor.hpp.
|
private |
Read pointer for RingBuffer.
Definition at line 68 of file RustyCompressor.hpp.