Fix sync_offset calculation
This commit is contained in:
parent
62edeeebce
commit
3e4f79380c
@ -53,7 +53,10 @@ impl<const ROWS: usize> Column<ROWS> {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if len > 0 {
|
if len > 0 {
|
||||||
let sync_offset = len - self.playback_position;
|
// Calculate the next beat position where recording will start
|
||||||
|
let current_beat = self.playback_position / self.frames_per_beat;
|
||||||
|
let next_beat = (current_beat + 1) % (len / self.frames_per_beat);
|
||||||
|
let sync_offset = next_beat * self.frames_per_beat;
|
||||||
track.record_auto_stop(len, sync_offset, last_volume_setting);
|
track.record_auto_stop(len, sync_offset, last_volume_setting);
|
||||||
} else {
|
} else {
|
||||||
track.record(last_volume_setting);
|
track.record(last_volume_setting);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user