Skip to content

Commit 5306bcb

Browse files
committed
fix harmonic effect parsing for gp4
1 parent 946336c commit 5306bcb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/parser/song_parser.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -921,12 +921,11 @@ pub fn parse_harmonic_effect(
921921
version: GpVersion,
922922
) -> impl FnMut(&[u8]) -> IResult<&[u8], HarmonicEffect> {
923923
move |i| {
924-
log::debug!("Parsing harmonic effect");
925924
let mut i = i;
926925
let mut he = HarmonicEffect::default();
927926
let (inner, harmonic_type) = parse_signed_byte(i)?;
928927
i = inner;
929-
928+
log::debug!("Parsing harmonic effect {}", harmonic_type);
930929
match harmonic_type {
931930
1 => he.kind = HarmonicType::Natural,
932931
2 => {
@@ -941,9 +940,11 @@ pub fn parse_harmonic_effect(
941940
}
942941
3 => {
943942
he.kind = HarmonicType::Tapped;
944-
let (inner, fret) = parse_byte(i)?;
945-
i = inner;
946-
he.right_hand_fret = Some(fret as i8);
943+
if version >= GpVersion::GP5 {
944+
let (inner, fret) = parse_byte(i)?;
945+
i = inner;
946+
he.right_hand_fret = Some(fret as i8);
947+
}
947948
}
948949
4 => he.kind = HarmonicType::Pinch,
949950
5 => he.kind = HarmonicType::Semi,

0 commit comments

Comments
 (0)