STEM-SDK  1.0
Native Instruments' Stem-SDK
stem_chain.h
1 //---------------------------------------------------------------------------------------------------------------------
2 //
3 // \copyright NATIVE INSTRUMENTS, Berlin, Germany, ALL RIGHTS RESERVED
4 //
5 //---------------------------------------------------------------------------------------------------------------------
6 
7 #pragma once
8 
9 #include <memory>
10 
11 namespace ni { namespace dsp {
12 
14 using stereo_in = const float* const [2];
15 
17 using stereo_out = float* const [2];
18 
19 
29 class stem_chain final
30 {
31 public:
32 
34  stem_chain( float sample_rate = 44100.f );
35 
36 
39  void process( stereo_in&, size_t frames, stereo_out& );
40 
47  void gain_reduction( stereo_in&, size_t frames, float* out_gain_reduction );
48 
51  int lookahead_size() const;
52 
53 
55  void sample_rate( float );
56 
58  float sample_rate() const;
59 
60 
61  // Compressor Interface
62 
64  void compressor_active( bool );
65 
67  bool compressor_active() const;
68 
69 
71  void compressor_input_gain( float );
72 
74  float compressor_input_gain() const;
75 
76 
78  void compressor_output_gain( float );
79 
81  float compressor_output_gain() const;
82 
83 
85  void compressor_threshold( float );
86 
88  float compressor_threshold() const;
89 
90 
93  void compressor_wet_dry_gain( float );
94 
96  float compressor_wet_dry_gain() const;
97 
98 
102  void compressor_ratio( float );
103 
105  float compressor_ratio() const;
106 
107 
109  void compressor_attack( float );
110 
112  float compressor_attack() const;
113 
114 
116  void compressor_release( float );
117 
119  float compressor_release() const;
120 
121 
127  void compressor_hp_cutoff( float );
128 
131  float compressor_hp_cutoff() const;
132 
133 
134  // Limiter Interface
135 
137  void limiter_active( bool );
138 
140  bool limiter_active() const;
141 
142 
144  void limiter_threshold( float );
145 
147  float limiter_threshold() const;
148 
149 
151  void limiter_release( float );
152 
154  float limiter_release() const;
155 
156 
158  void limiter_ceiling( float );
159 
161  float limiter_ceiling() const;
162 
163 
164  // Meters
165 
167  void meters_active( bool );
168 
170  bool meters_active() const;
171 
172 
173  // Compressor Meters
174 
178  float compressor_input_level_rms() const;
179 
183  float compressor_output_level_rms() const;
184 
187  float compressor_input_level_peak() const;
188 
191  float compressor_output_level_peak() const;
192 
194  float compressor_gain_reduction() const;
195 
196 
197  // Limiter Meters
198 
202  float limiter_input_level_rms() const;
203 
207  float limiter_output_level_rms() const;
208 
211  float limiter_input_level_peak() const;
212 
215  float limiter_output_level_peak() const;
216 
218  float limiter_gain_reduction() const;
219 
220 
221  ~stem_chain();
222 
223 private:
224 
225  std::unique_ptr< class stem_chain_impl > m_impl;
226 };
227 
228 } }
float limiter_output_level_rms() const
Returns the Limiter's output RMS level in dB. ~3dB offset is added such that meter level is at 0dB fo...
float limiter_input_level_rms() const
Returns the Limiter's input RMS level in dB. ~3dB offset is added such that meter level is at 0dB for...
float compressor_attack() const
Returns the Compressor's attack time in seconds.
float compressor_input_level_peak() const
Returns the Compressor's input peak level in dB. Min supported meter range is -100dB.
float sample_rate() const
Returns the current sample rate.
float limiter_threshold() const
Returns the Limiter's threshold in dB.
void process(stereo_in &, size_t frames, stereo_out &)
Process a two channel input signal for the specified amount of frames. The resulting audio samples ar...
void gain_reduction(stereo_in &, size_t frames, float *out_gain_reduction)
Computes the gain reduction curve delayed by the Stem Mastering Chain's lookahead size for the specif...
float compressor_ratio() const
Returns the Compressor's ratio.
float compressor_release() const
Returns the Compressor's release time in seconds.
stem_chain(float sample_rate=44100.f)
Creates a Stem Mastering Chain with the specified sample rate.
float compressor_threshold() const
Returns the Compressor's threshold in dB.
float compressor_hp_cutoff() const
Returns the Compressor's highpass filter cutoff frequency in Hz. A value of 0.f indicates that the hi...
float limiter_input_level_peak() const
Returns the Limiter's input peak level in dB. Min supported meter range is -100dB.
float compressor_input_level_rms() const
Returns the Compressor's input RMS level in dB. ~3dB offset is added such that meter level is at 0dB ...
bool meters_active() const
Returns true if the Level Meters are activated.
float limiter_release() const
Returns the Limiter's release time in seconds.
float compressor_output_level_rms() const
Returns the Compressor's output RMS level in dB. ~3dB offset is added such that meter level is at 0dB...
float compressor_gain_reduction() const
Returns the Compressor's gain reduction in positive dB values.
float compressor_input_gain() const
Returns the Compressor's input gain in dB.
The Stem Mastering Chain is composed of a Compressor followed by a Limiter to create the finalized so...
Definition: stem_chain.h:29
float limiter_output_level_peak() const
Returns the Limiter's output peak level in dB. Min supported meter range is -100dB.
bool limiter_active() const
Returns true if the Limiter is activated.
Definition: stem_chain.h:11
bool compressor_active() const
Returns true if the Compressor is activated.
float limiter_gain_reduction() const
Returns the Limiter's gain reduction in positive dB values.
float limiter_ceiling() const
Returns the Limiter's ceiling in dB.
float compressor_wet_dry_gain() const
Returns the Compressor's wetness in percent.
float compressor_output_level_peak() const
Returns the Compressor's output peak level in dB. Min supported meter range is -100dB.
int lookahead_size() const
Returns the limiter's lookahead size in samples. Lookahead size is 32 samples @ 44.1kHz and gets scaled by sample rate.
float compressor_output_gain() const
Returns the Compressor's output gain in dB.