From 9d299f3e668f22dc53c559d219c4e839c3ab2287 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Fri, 4 Aug 2023 23:07:19 +0100 Subject: [PATCH] Fix out by one error with instrument samples --- tracker/agb-xm-core/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracker/agb-xm-core/src/lib.rs b/tracker/agb-xm-core/src/lib.rs index a93ac214..81ec9b50 100644 --- a/tracker/agb-xm-core/src/lib.rs +++ b/tracker/agb-xm-core/src/lib.rs @@ -124,7 +124,8 @@ pub fn parse_module(module: &Module) -> TokenStream { if let InstrumentType::Default(ref instrument) = module.instrument[instrument_index].instr_type { - let sample_slot = instrument.sample_for_note[slot.note as usize] as usize; + let sample_slot = + instrument.sample_for_note[slot.note as usize - 1] as usize; instruments_map .get(&(instrument_index, sample_slot)) .map(|sample_idx| sample_idx + 1)