mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
sync midi by frames rather than useconds
This commit is contained in:
parent
63b5eb3740
commit
b1e4ec3a88
4 changed files with 29 additions and 17 deletions
|
|
@ -119,7 +119,7 @@ impl Track {
|
|||
input: MidiIter,
|
||||
timebase: &Arc<Timebase>,
|
||||
playing: Option<TransportState>,
|
||||
started: Option<usize>,
|
||||
started: Option<(usize, usize)>,
|
||||
quant: usize,
|
||||
reset: bool,
|
||||
scope: &ProcessScope,
|
||||
|
|
@ -145,13 +145,13 @@ 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(started) = started {
|
||||
if let Some((start_frame, start_usec)) = started {
|
||||
if let Some(phrase) = phrase {
|
||||
phrase.process_out(
|
||||
&mut self.midi_out_buf,
|
||||
&mut self.notes_on,
|
||||
timebase,
|
||||
(usec0 - started, usecs, period)
|
||||
(frame0.saturating_sub(start_frame), frames, period)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue