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:
parent
82e74a7c53
commit
7c8da39159
1 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue