42 #ifndef __COMPRESSOR_H__
43 #define __COMPRESSOR_H__
58 bool verboseIn =
false,
60 float thresholdDBIn = -24.0f,
61 float attackMSIn = 15.0f,
62 float releaseMSIn = 40.0f,
63 float makeUpGainDBIn = 2.0f)
64 : mNumChannels(numchans)
66 , thresholdDB(thresholdDBIn)
67 , attackMS(attackMSIn)
68 , releaseMS(releaseMSIn)
69 , makeUpGainDB(makeUpGainDBIn)
73 for (
int i = 0; i < mNumChannels; i++ ) {
75 compressorUIP.push_back(
new APIUI);
76 compressorP[i]->buildUserInterface(compressorUIP[i]);
81 bool verboseIn =
false,
92 for (
int i = 0; i < mNumChannels; i++ ) {
93 delete compressorP[i];
94 delete compressorUIP[i];
97 compressorUIP.clear();
102 for (
int i = 0; i < mNumChannels; i++ ) {
103 int ndx = compressorUIP[i]->getParamIndex(pName);
105 compressorUIP[i]->setParamValue(ndx, p);
107 std::cout <<
"Compressor.h: parameter " << pName <<
" set to " << p <<
" on audio channel " << i <<
"\n";
110 std::cerr <<
"*** Compressor.h: Could not find parameter named " << pName <<
"\n";
115 void init(
int samplingRate)
override {
118 std::cerr <<
"Sampling rate not set by superclass!\n";
121 for (
int i = 0; i < mNumChannels; i++ ) {
122 compressorP[i]->init(fs);
134 void compute(
int nframes,
float** inputs,
float** outputs)
override;
139 std::vector<compressordsp*> compressorP;
140 std::vector<APIUI*> compressorUIP;
Definition: compressordsp.h:1031
Applies compressor_mono from the faustlibraries distribution, compressors.lib.
Definition: Compressor.h:54
virtual ~Compressor()
The class destructor.
Definition: Compressor.h:91
void compute(int nframes, float **inputs, float **outputs) override
Compute process.
Definition: Compressor.cpp:44
int getNumOutputs() override
Return Number of Output Channels.
Definition: Compressor.h:133
int getNumInputs() override
Return Number of Input Channels.
Definition: Compressor.h:132
Compressor(int numchans, bool verboseIn=false, CompressorPreset preset=CompressorPresets::voice)
Definition: Compressor.h:80
void init(int samplingRate) override
Do proper Initialization of members and class instances. By default this initializes the Sampling Fre...
Definition: Compressor.h:115
Compressor(int numchans, bool verboseIn=false, float ratioIn=2.0f, float thresholdDBIn=-24.0f, float attackMSIn=15.0f, float releaseMSIn=40.0f, float makeUpGainDBIn=2.0f)
The class constructor sets the number of audio channels and default parameters.
Definition: Compressor.h:57
void setParamAllChannels(const char pName[], float p)
Definition: Compressor.h:101
Interface for the process plugins to add to the JACK callback process in JackAudioInterface.
Definition: ProcessPlugin.h:53
virtual void setVerbose(bool v)
Definition: ProcessPlugin.h:86
int fSamplingFreq
Faust Data member, Sampling Rate.
Definition: ProcessPlugin.h:92
virtual void init(int samplingRate)
Do proper Initialization of members and class instances. By default this initializes the Sampling Fre...
Definition: ProcessPlugin.h:78
bool inited
Definition: ProcessPlugin.h:93
bool verbose
Definition: ProcessPlugin.h:94
Definition: compressordsp.h:1575
const CompressorPreset voice
Definition: CompressorPresets.h:24
Definition: CompressorPresets.h:5