From 81308d0c8d648cdff3a424ca25fb329673e888b6 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 7 Mar 2022 20:44:26 +0100 Subject: [PATCH] Change gain multiplier coefficients --- plugins/puberty_simulator/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/puberty_simulator/src/lib.rs b/plugins/puberty_simulator/src/lib.rs index 08c13886..679aac5a 100644 --- a/plugins/puberty_simulator/src/lib.rs +++ b/plugins/puberty_simulator/src/lib.rs @@ -132,7 +132,7 @@ impl Plugin for PubertySimulator { fn process(&mut self, buffer: &mut Buffer, context: &mut impl ProcessContext) -> ProcessStatus { // Compensate for the window function, the overlap, and the extra gain introduced by the // IDFT operation - const GAIN_COMPENSATION: f32 = 1.0 / OVERLAP_TIMES as f32 / WINDOW_SIZE as f32; + const GAIN_COMPENSATION: f32 = 2.0 / OVERLAP_TIMES as f32 / WINDOW_SIZE as f32; let sample_rate = context.transport().sample_rate; @@ -191,7 +191,7 @@ impl Plugin for PubertySimulator { self.complex_fft_scratch_buffer[bin_idx] = (target_low * target_low_t + target_high * target_high_t) - * 6.0 // Random extra gain, not sure + * 3.0 // Random extra gain, not sure * GAIN_COMPENSATION; }; @@ -203,7 +203,7 @@ impl Plugin for PubertySimulator { for bin_idx in (0..num_bins).rev() { process_bin(bin_idx); } - }; + } // Inverse FFT back into the scratch buffer. This will be added to a ring buffer // which gets written back to the host at a one block delay.