-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathURCompressor.h
More file actions
46 lines (29 loc) · 915 Bytes
/
URCompressor.h
File metadata and controls
46 lines (29 loc) · 915 Bytes
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
37
38
39
40
41
42
43
44
45
46
/*
==============================================================================
URCompressor.h
Created: 25 Jun 2021 7:53:02pm
Author: asla_
==============================================================================
*/
#pragma once
#include "EnvelopeShaper.h"
#include <cmath>
#include <algorithm>
class Compressor{
private:
float m_Threshold;
float m_Ratio;
EnvelopeShaper m_EnvelopeShaper;
const float BOUND_LOG = -96.f;
const float BOUND_LIN = decibelToAmplitude(BOUND_LOG);
float AmplitudeToDecibel(float amplitude);
float decibelToAmplitude(float db);
public:
Compressor();
void setRatio(float ratio);
void setTreshold(float thresh);
void setAttack(float attack);
void setRelease(float release);
void setSampleRate(float sampleRate);
void processAudioSample(float& sample);
};