MCPcopy Create free account
hub / github.com/PerroEngine/Perro / apply_compression

Function apply_compression

perro_source/audio_stack/perro_pawdio/src/dsp.rs:262–275  ·  view source on GitHub ↗
(sample: f32, compression: AudioCompression)

Source from the content-addressed store, hash-verified

260 self.param_counter += 1;
261 if self.param_counter >= PARAM_REFRESH_SAMPLES {
262 self.param_counter = 0;
263 }
264 let params = self.params;
265 let ch = self.channel_index.min(self.channels - 1);
266 let mut sample = input;
267
268 // Unity EQ is an identity passthrough; skip the two filter updates.
269 if !eq_is_dry(params.eq) {
270 sample = self.apply_eq(ch, sample, params.eq);
271 }
272 sample = self.apply_low_pass(ch, sample, params.low_pass.max(params.occlusion * 0.8));
273
274 let echo_wet = params.echo.max(params.reflection * 0.35).clamp(0.0, 1.0);
275 let reverb_wet = params
276 .reverb_send
277 .max(params.reflection * 0.25)
278 .clamp(0.0, 1.0);

Callers 2

nextMethod · 0.85
compression_reduces_peakFunction · 0.85

Calls 4

clampMethod · 0.45
maxMethod · 0.45
signumMethod · 0.45
absMethod · 0.45

Tested by 1

compression_reduces_peakFunction · 0.68