From b8adf083822d61772784bf0b7cdf174b2454fec3 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 18 Jul 2023 22:17:17 +0100 Subject: [PATCH] Don't hold arpeggios --- tracker/agb-tracker/src/lib.rs | 6 ++++-- tracker/agb-xm-core/src/lib.rs | 25 ++++++------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/tracker/agb-tracker/src/lib.rs b/tracker/agb-tracker/src/lib.rs index cdf5f10c..903feebf 100644 --- a/tracker/agb-tracker/src/lib.rs +++ b/tracker/agb-tracker/src/lib.rs @@ -177,6 +177,8 @@ impl TrackerChannel { self.base_speed = speed; } + channel.playback(self.base_speed); + match effect { PatternEffect::None => {} PatternEffect::Stop => { @@ -185,8 +187,8 @@ impl TrackerChannel { PatternEffect::Arpeggio(first, second) => { match tick % 3 { 0 => channel.playback(self.base_speed), - 1 => channel.playback(self.base_speed + first.change_base()), - 2 => channel.playback(self.base_speed + second.change_base()), + 1 => channel.playback(first.change_base()), + 2 => channel.playback(second.change_base()), _ => unreachable!(), }; } diff --git a/tracker/agb-xm-core/src/lib.rs b/tracker/agb-xm-core/src/lib.rs index f6476114..f47d20bb 100644 --- a/tracker/agb-xm-core/src/lib.rs +++ b/tracker/agb-xm-core/src/lib.rs @@ -172,13 +172,6 @@ pub fn parse_module(module: &Module) -> TokenStream { let first_arpeggio = slot.effect_parameter >> 4; let second_arpeggio = slot.effect_parameter & 0xF; - let note_speed = note_to_speed( - *note, - sample.fine_tune, - sample.relative_note, - module.frequency_type, - ); - let first_arpeggio_speed = note_to_speed( *note, sample.fine_tune, @@ -192,19 +185,13 @@ pub fn parse_module(module: &Module) -> TokenStream { module.frequency_type, ); - let first_arpeggio_difference = first_arpeggio_speed - note_speed; - let second_arpeggio_difference = second_arpeggio_speed - note_speed; - - let first_arpeggio_difference = first_arpeggio_difference - .try_change_base() - .expect("Arpeggio difference too large"); - let second_arpeggio_difference = second_arpeggio_difference - .try_change_base() - .expect("Arpeggio difference too large"); - PatternEffect::Arpeggio( - first_arpeggio_difference, - second_arpeggio_difference, + first_arpeggio_speed + .try_change_base() + .expect("Arpeggio size too large"), + second_arpeggio_speed + .try_change_base() + .expect("Arpeggio size too large"), ) } else { PatternEffect::None