wip: correct cycle timings (jitter eats notes)

This commit is contained in:
🪞👃🪞 2024-07-05 14:36:09 +03:00
parent e83802e1fd
commit 665885f6ff
5 changed files with 90 additions and 76 deletions

View file

@ -237,17 +237,23 @@ process!(App |self, _client, scope| {
}
self.playing = Some(transport.state);
self.playhead = transport.pos.frame() as usize;
let frame = scope.last_frame_time() as usize;
let frames = scope.n_frames() as usize;
let CycleTimes {
current_frames,
current_usecs,
next_usecs,
period_usecs
} = scope.cycle_times().unwrap();
for track in self.tracks.iter_mut() {
track.process(
self.midi_in.as_ref().unwrap().iter(scope),
&self.timebase,
self.playing,
&scope,
self.playhead,
frames,
panic,
&scope,
(current_frames as usize, frames),
(current_usecs as usize, next_usecs.saturating_sub(current_usecs) as usize),
period_usecs as f64
);
}
Control::Continue