1
0
Fork 0

Tweak the gain compensation

This commit is contained in:
Robbert van der Helm 2022-03-07 21:33:00 +01:00
parent 715ba467a9
commit ef1abe0508

View file

@ -181,7 +181,7 @@ impl Plugin for PubertySimulator {
let window_size = self.window_size(); let window_size = self.window_size();
let overlap_times = self.overlap_times(); let overlap_times = self.overlap_times();
let sample_rate = context.transport().sample_rate; 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 // 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 // our latency. All of these buffers already have enough capacity