mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Fix position increment in STFT helper
This was what was causing the spectral leakage. It already sounded like parts of the buffer were being cleared too early or old parts were being reused, but I guess that makes sense now...
This commit is contained in:
@@ -205,6 +205,9 @@ impl<const NUM_SIDECHAIN_INPUTS: usize> StftHelper<NUM_SIDECHAIN_INPUTS> {
|
||||
}
|
||||
}
|
||||
|
||||
already_processed_samples += samples_to_process;
|
||||
self.current_pos = (self.current_pos + samples_to_process) % block_size;
|
||||
|
||||
// At this point we either have `already_processed_samples == main_buffer_len`, or
|
||||
// `self.current_pos % window_interval == 0`. If it's the latter, then we can process a
|
||||
// new block.
|
||||
@@ -253,10 +256,6 @@ impl<const NUM_SIDECHAIN_INPUTS: usize> StftHelper<NUM_SIDECHAIN_INPUTS> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Do this after handling the block or else we'll copy the wrong samples.
|
||||
already_processed_samples += samples_to_process;
|
||||
self.current_pos = (self.current_pos + samples_to_process) % block_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user