From 924b68fccfc33328d69b40940e171762dd541f14 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Sat, 2 Nov 2024 01:29:28 +0200 Subject: [PATCH] launch pt.10: almost works! --- crates/tek_sequencer/src/sequencer_snd.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/tek_sequencer/src/sequencer_snd.rs b/crates/tek_sequencer/src/sequencer_snd.rs index dd6f381d..1f6b52ff 100644 --- a/crates/tek_sequencer/src/sequencer_snd.rs +++ b/crates/tek_sequencer/src/sequencer_snd.rs @@ -59,7 +59,9 @@ impl PhrasePlayer { if let Some((started, phrase)) = &self.phrase { // First sample to populate. Greater than 0 means that the first // pulse of the phrase falls somewhere in the middle of the chunk. - let sample = sample0.saturating_sub(started.sample.get() as usize); + let sample = sample0.saturating_sub( + started.sample.get() as usize + self.clock.started.read().unwrap().unwrap().0 + ); // Iterator that emits sample (index into output buffer at which to write MIDI event) // paired with pulse (index into phrase from which to take the MIDI event) for each // sample of the output buffer that corresponds to a MIDI pulse.