Don't hold arpeggios

This commit is contained in:
Gwilym Inzani 2023-07-18 22:17:17 +01:00
parent 03b5f2fafd
commit b8adf08382
2 changed files with 10 additions and 21 deletions

View file

@ -177,6 +177,8 @@ impl TrackerChannel {
self.base_speed = speed; self.base_speed = speed;
} }
channel.playback(self.base_speed);
match effect { match effect {
PatternEffect::None => {} PatternEffect::None => {}
PatternEffect::Stop => { PatternEffect::Stop => {
@ -185,8 +187,8 @@ impl TrackerChannel {
PatternEffect::Arpeggio(first, second) => { PatternEffect::Arpeggio(first, second) => {
match tick % 3 { match tick % 3 {
0 => channel.playback(self.base_speed), 0 => channel.playback(self.base_speed),
1 => channel.playback(self.base_speed + first.change_base()), 1 => channel.playback(first.change_base()),
2 => channel.playback(self.base_speed + second.change_base()), 2 => channel.playback(second.change_base()),
_ => unreachable!(), _ => unreachable!(),
}; };
} }

View file

@ -172,13 +172,6 @@ pub fn parse_module(module: &Module) -> TokenStream {
let first_arpeggio = slot.effect_parameter >> 4; let first_arpeggio = slot.effect_parameter >> 4;
let second_arpeggio = slot.effect_parameter & 0xF; 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( let first_arpeggio_speed = note_to_speed(
*note, *note,
sample.fine_tune, sample.fine_tune,
@ -192,19 +185,13 @@ pub fn parse_module(module: &Module) -> TokenStream {
module.frequency_type, 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( PatternEffect::Arpeggio(
first_arpeggio_difference, first_arpeggio_speed
second_arpeggio_difference, .try_change_base()
.expect("Arpeggio size too large"),
second_arpeggio_speed
.try_change_base()
.expect("Arpeggio size too large"),
) )
} else { } else {
PatternEffect::None PatternEffect::None