From 3b2111ae310b479b1688d1563068274a69d5650d Mon Sep 17 00:00:00 2001 From: Viv Date: Fri, 2 Jun 2023 16:33:42 -0400 Subject: [PATCH] `tja2fumen.py`: Fix assumption about drumroll padding bytes The 8 bytes after a drumroll are NOT just padding, as `fumen2osu.py` assumed. There is some kind of metadata here; I just need to determine what it stands for. --- tja2fumen/tja2fumen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tja2fumen/tja2fumen.py b/tja2fumen/tja2fumen.py index 4cc2e70..03ee85f 100644 --- a/tja2fumen/tja2fumen.py +++ b/tja2fumen/tja2fumen.py @@ -248,7 +248,7 @@ def readFumen(fumenFile, byteOrder=None, debug=False): # Seek forward 8 bytes to account for padding bytes at the end of drumrolls if noteType == 0x6 or noteType == 0x9 or noteType == 0x62: - file.seek(0x8, os.SEEK_CUR) + note["drumrollBytes"] = file.read(8) # Assign the note to the branch branch[noteNumber] = note @@ -356,7 +356,7 @@ def writeFumen(file, song): noteStruct.append(note['durationPadding']) writeStruct(file, order, format_string="ififHHf", value_list=noteStruct) if note['type'].lower() == "drumroll": - file.seek(0x8, os.SEEK_CUR) + file.write(note['drumrollBytes']) file.close()