count time from start of playback

This commit is contained in:
🪞👃🪞 2024-07-05 18:42:13 +03:00
parent f6a7cbf38e
commit 52ea78a466
3 changed files with 309 additions and 285 deletions

View file

@ -115,6 +115,7 @@ impl Track {
input: MidiIter,
timebase: &Arc<Timebase>,
playing: Option<TransportState>,
started: Option<usize>,
quant: usize,
panic: bool,
scope: &ProcessScope,
@ -136,13 +137,15 @@ impl Track {
// Play from phrase into output buffer
let phrase = &mut self.sequence.map(|id|self.phrases.get_mut(id)).flatten();
if playing == Some(TransportState::Rolling) {
if let Some(phrase) = phrase {
phrase.process_out(
&mut self.midi_out_buf,
&mut self.notes_on,
timebase,
(usec0, usecs, period)
);
if let Some(started) = started {
if let Some(phrase) = phrase {
phrase.process_out(
&mut self.midi_out_buf,
&mut self.notes_on,
timebase,
(usec0 - started, usecs, period)
);
}
}
}
// Monitor and record input