diff --git a/tracker/agb-tracker/src/lib.rs b/tracker/agb-tracker/src/lib.rs index f729868f..834f702d 100644 --- a/tracker/agb-tracker/src/lib.rs +++ b/tracker/agb-tracker/src/lib.rs @@ -375,12 +375,14 @@ impl TrackerChannel { PatternEffect::TonePortamento(amount, target) => { channel.volume(self.volume.try_change_base().unwrap()); - if *amount < 1.into() { - self.base_speed = - (self.base_speed * amount.change_base()).max(target.change_base()); - } else { - self.base_speed = - (self.base_speed * amount.change_base()).min(target.change_base()); + if tick != 0 { + if *amount < 1.into() { + self.base_speed = + (self.base_speed * amount.change_base()).max(target.change_base()); + } else { + self.base_speed = + (self.base_speed * amount.change_base()).min(target.change_base()); + } } channel.playback(self.base_speed.change_base()); diff --git a/tracker/agb-xm-core/src/lib.rs b/tracker/agb-xm-core/src/lib.rs index c4f196f3..4396293c 100644 --- a/tracker/agb-xm-core/src/lib.rs +++ b/tracker/agb-xm-core/src/lib.rs @@ -469,7 +469,7 @@ fn note_to_frequency_amega(note: Note, fine_tune: f64, relative_note: i8) -> f64 let note = (note as usize) .checked_add_signed(relative_note as isize) .expect("Note gone negative"); - let pos = (note % 12) * 8 + (fine_tune / 16.0) as usize; + let pos = ((note % 12) * 8 + (fine_tune / 16.0) as usize).min(AMEGA_FREQUENCIES.len() - 2); let frac = (fine_tune / 16.0) - (fine_tune / 16.0).floor(); let period = ((AMEGA_FREQUENCIES[pos] as f64 * (1.0 - frac))