1
1
/*
2
- * Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3
- * (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com>
2
+ * Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3
+ * (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
4
4
*
5
5
* This file is part of lsp-dsp-units
6
6
* Created on: 16 сент. 2016 г.
@@ -55,16 +55,20 @@ namespace lsp
55
55
float fRelease ;
56
56
float fKnee ;
57
57
float fRatio ;
58
+ float fHold ;
58
59
float fEnvelope ;
60
+ float fPeak ;
59
61
60
62
// Pre-calculated parameters
61
63
float fTauAttack ;
62
64
float fTauRelease ;
63
65
comp_t sComp ; // Two compressor knees
64
66
65
67
// Additional parameters
66
- size_t nSampleRate;
67
- size_t nMode;
68
+ uint32_t nHold;
69
+ uint32_t nHoldCounter;
70
+ uint32_t nSampleRate;
71
+ uint32_t nMode;
68
72
bool bUpdate;
69
73
70
74
public:
@@ -102,13 +106,43 @@ namespace lsp
102
106
*/
103
107
void update_settings ();
104
108
109
+ /* *
110
+ * Get attack threshold of compressor
111
+ * @return attack threshold of compressor
112
+ */
113
+ inline float attack_threshold () const { return fAttackThresh ; }
114
+
115
+ /* *
116
+ * Set attack threshold
117
+ * @param threshold attack threshold
118
+ */
119
+ void set_attack_threshold (float threshold);
120
+
121
+ /* *
122
+ * Get release threshold of compressor
123
+ * @return release threshold of compressor
124
+ */
125
+ inline float release_threshold () const { return fReleaseThresh ; }
126
+
127
+ /* *
128
+ * Set release threshold
129
+ * @param threshold release threshold
130
+ */
131
+ void set_release_threshold (float threshold);
132
+
105
133
/* * Set compressor threshold
106
134
*
107
135
* @param attack the attack threshold
108
136
* @param release the release threshold (relative to attack, must be positive, less or equal to 1.0)
109
137
*/
110
138
void set_threshold (float attack, float release);
111
139
140
+ /* *
141
+ * Get boost threshold of compressor
142
+ * @return boost threshold of compressor
143
+ */
144
+ inline float boost_threshold () const { return fBoostThresh ; }
145
+
112
146
/* *
113
147
* Set boost threshold, valid for upward compression only
114
148
* @param boost boost threshold
@@ -122,30 +156,60 @@ namespace lsp
122
156
*/
123
157
void set_timings (float attack, float release);
124
158
159
+ /* *
160
+ * Get attack time
161
+ * @return attack time (ms)
162
+ */
163
+ inline float attack () const { return fAttack ; }
164
+
125
165
/* * Set attack time
126
166
*
127
167
* @param attack attack time (ms)
128
168
*/
129
169
void set_attack (float attack);
130
170
171
+ /* *
172
+ * Get release time of compressor
173
+ * @return release time of compressor (ms)
174
+ */
175
+ inline float release () const { return fRelease ; }
176
+
131
177
/* * Set release time
132
178
*
133
179
* @param release release time (ms)
134
180
*/
135
181
void set_release (float release);
136
182
183
+ /* *
184
+ * Get sample rate
185
+ * @return sample rate
186
+ */
187
+ inline size_t sample_rate () const { return nSampleRate; }
188
+
137
189
/* * Set compressor's sample rate
138
190
*
139
191
* @param sr sample rate
140
192
*/
141
193
void set_sample_rate (size_t sr);
142
194
195
+ /* *
196
+ * Get compressor knee
197
+ * @return compressor knee
198
+ */
199
+ inline float knee () const { return fKnee ; }
200
+
143
201
/* * Set compressor's knee
144
202
*
145
203
* @param knee (in gain units)
146
204
*/
147
205
void set_knee (float knee);
148
206
207
+ /* *
208
+ * Get compression ratio
209
+ * @return compression ratio
210
+ */
211
+ inline float ratio () const { return fRatio ; }
212
+
149
213
/* * Set compression ratio
150
214
*
151
215
* @param ratio compression ratio
@@ -158,6 +222,20 @@ namespace lsp
158
222
*/
159
223
void set_mode (size_t mode);
160
224
225
+ inline size_t mode () const { return nMode; }
226
+
227
+ /* *
228
+ * Get the hold time of compressor
229
+ * @return hold time of compressor
230
+ */
231
+ float hold () const { return fHold ; }
232
+
233
+ /* *
234
+ * Set hold time in milliseconds
235
+ * @param hold hold time in milliseconds
236
+ */
237
+ void set_hold (float hold);
238
+
161
239
/* * Process sidechain signal
162
240
*
163
241
* @param out output signal gain to VCA
0 commit comments