From ef1abe0508e69e5a5c9a63f12a2651d0828e88ba Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 7 Mar 2022 21:33:00 +0100 Subject: [PATCH] Tweak the gain compensation --- plugins/puberty_simulator/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/puberty_simulator/src/lib.rs b/plugins/puberty_simulator/src/lib.rs index d4c8b02d..61d65437 100644 --- a/plugins/puberty_simulator/src/lib.rs +++ b/plugins/puberty_simulator/src/lib.rs @@ -181,7 +181,7 @@ impl Plugin for PubertySimulator { let window_size = self.window_size(); let overlap_times = self.overlap_times(); let sample_rate = context.transport().sample_rate; - let gain_compensation: f32 = 2.0 / overlap_times as f32 / window_size as f32; + let gain_compensation: f32 = 1.0 / (overlap_times as f32).log2() / window_size as f32; // If the window size has changed since the last process call, reset the buffers and chance // our latency. All of these buffers already have enough capacity