From ebb06a7f45852f468a75c7488e1d07027600a5af Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 22 Nov 2025 00:48:19 -0500 Subject: audio: fix tempo (off by one, rahhhgit status!) --- graphics/src/audio/mod.rs | 3 +-- graphics/src/audio/program.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/graphics/src/audio/mod.rs b/graphics/src/audio/mod.rs index a8c24ad..f0de9d4 100644 --- a/graphics/src/audio/mod.rs +++ b/graphics/src/audio/mod.rs @@ -13,8 +13,7 @@ mod parse; mod program; const AUDIO_FPS: u32 = 60; - -pub const TIME_SLICE: Duration = Duration::from_millis(1000 / AUDIO_FPS as u64); +const TIME_SLICE: Duration = Duration::from_millis(1000 / AUDIO_FPS as u64); /// Holds each audio channel pub struct Channels { diff --git a/graphics/src/audio/program.rs b/graphics/src/audio/program.rs index 91f0608..270a214 100644 --- a/graphics/src/audio/program.rs +++ b/graphics/src/audio/program.rs @@ -99,7 +99,7 @@ impl Program { match ins { I::Pause => { // pause execution until next `exec` call - self.pause = (AUDIO_FPS * 4) / self.tempo.clamp(1, 240); + self.pause = (AUDIO_FPS * 8) / self.tempo.clamp(1, 240); } I::Jump(pc) => { self.pc = pc; @@ -144,7 +144,6 @@ impl Program { pub fn exec(&mut self, channels: &mut Channels) { if self.pause > 0 { self.pause -= 1; - return; } loop { if self.pause > 0 { -- cgit v1.2.3-freya