13 /* General topology and basic automation was based on the following paper:
15 * D. Giannoulis, M. Massberg and J. D. Reiss,
16 * "Parameter Automation in a Dynamic Range Compressor,"
17 * Journal of the Audio Engineering Society, v61 (10), Oct. 2013
19 * Available (along with supplemental reading) at:
21 * http://c4dm.eecs.qmul.ac.uk/audioengineering/compressors/
47 alignas(16) ALfloat SideChain
[2*BUFFERSIZE
];
48 alignas(16) ALfloat CrestFactor
[BUFFERSIZE
];
51 ALfloat (*Delay
)[BUFFERSIZE
];
67 /* The compressor is initialized with the following settings:
69 * NumChans - Number of channels to process.
70 * SampleRate - Sample rate to process.
71 * AutoKnee - Whether to automate the knee width parameter.
72 * AutoAttack - Whether to automate the attack time parameter.
73 * AutoRelease - Whether to automate the release time parameter.
74 * AutoPostGain - Whether to automate the make-up (post) gain parameter.
75 * AutoDeclip - Whether to automate clipping reduction. Ignored when
76 * not automating make-up gain.
77 * LookAheadTime - Look-ahead time (in seconds).
78 * HoldTime - Peak hold-time (in seconds).
79 * PreGainDb - Gain applied before detection (in dB).
80 * PostGainDb - Make-up gain applied after compression (in dB).
81 * ThresholdDb - Triggering threshold (in dB).
82 * Ratio - Compression ratio (x:1). Set to INFINIFTY for true
83 * limiting. Ignored when automating knee width.
84 * KneeDb - Knee width (in dB). Ignored when automating knee
86 * AttackTimeMin - Attack time (in seconds). Acts as a maximum when
87 * automating attack time.
88 * ReleaseTimeMin - Release time (in seconds). Acts as a maximum when
89 * automating release time.
91 Compressor
* CompressorInit(const ALsizei NumChans
, const ALuint SampleRate
,
92 const ALboolean AutoKnee
, const ALboolean AutoAttack
,
93 const ALboolean AutoRelease
, const ALboolean AutoPostGain
,
94 const ALboolean AutoDeclip
, const ALfloat LookAheadTime
,
95 const ALfloat HoldTime
, const ALfloat PreGainDb
,
96 const ALfloat PostGainDb
, const ALfloat ThresholdDb
,
97 const ALfloat Ratio
, const ALfloat KneeDb
,
98 const ALfloat AttackTime
, const ALfloat ReleaseTime
);
100 void ApplyCompression(struct Compressor
*Comp
, const ALsizei SamplesToDo
,
101 ALfloat (*RESTRICT OutBuffer
)[BUFFERSIZE
]);
103 ALsizei
GetCompressorLookAhead(const struct Compressor
*Comp
);
105 #endif /* MASTERING_H */