Fix copying tail to playback buffer
I noticed the effect wasn't deterministic, when I saw this. Oops.
This commit is contained in:
parent
333ff2c05e
commit
e6c43e35d3
|
@ -118,8 +118,9 @@ impl RingBuffer {
|
|||
let copy_num_from_end = note_period_samples - copy_num_from_start;
|
||||
playback_buffer[0..copy_num_from_end]
|
||||
.copy_from_slice(&recording_buffer[recording_buffer.len() - copy_num_from_end..]);
|
||||
playback_buffer[copy_num_from_end..]
|
||||
.copy_from_slice(&recording_buffer[..copy_num_from_start]);
|
||||
playback_buffer[copy_num_from_end..].copy_from_slice(
|
||||
&recording_buffer[self.next_write_pos - copy_num_from_start..self.next_write_pos],
|
||||
);
|
||||
}
|
||||
|
||||
// The playback buffer is normalized as necessary. This prevents small grains from being
|
||||
|
|
Loading…
Reference in a new issue