-
Notifications
You must be signed in to change notification settings - Fork 0
/
Compressor.h
36 lines (30 loc) · 857 Bytes
/
Compressor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Compressor.h
#ifndef COMPRESSOR_H
#define COMPRESSOR_H
class Compressor
{
public:
Compressor(float threshold, float ratio, float attackTime, float releaseTime, float kneeWidth, float makeupGain, float sampleRate);
float process(float inputSample);
void setThreshold(float threshold);
void setRatio(float ratio);
void setAttackTime(float attackTime);
void setReleaseTime(float releaseTime);
void setKneeWidth(float kneeWidth);
void setMakeupGain(float makeupGain);
private:
float threshold_;
float ratio_;
float attackTime_;
float releaseTime_;
float kneeWidth_;
float makeupGain_;
float envelope_;
float gain_;
float sampleRate_;
float attackCoefficient_;
float releaseCoefficient_;
float dBToLinear(float dB);
void updateCoefficients();
};
#endif // COMPRESSOR_H