From cf50223dfc5c8039fd731fcf62057916fbe40c6b Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Wed, 8 Nov 2023 00:14:17 +0000 Subject: [PATCH] It seems to do better without the tune for some reason --- tracker/agb-midi-core/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracker/agb-midi-core/src/lib.rs b/tracker/agb-midi-core/src/lib.rs index 24687fb7..cc62b11a 100644 --- a/tracker/agb-midi-core/src/lib.rs +++ b/tracker/agb-midi-core/src/lib.rs @@ -366,9 +366,9 @@ struct SampleData { note_offset: i32, } -fn midi_key_to_speed(key: i16, sample: &SampleData, tune: f64) -> Num { +fn midi_key_to_speed(key: i16, sample: &SampleData, _tune: f64) -> Num { let sample_rate = sample.sample_rate as f64; let relative_note = sample.note_offset as f64; - Num::from_f64(2f64.powf((key as f64 - tune - relative_note) / 12.0) * 32768.0 / sample_rate) + Num::from_f64(2f64.powf((key as f64 - relative_note) / 12.0) * sample_rate / 32768.0) }