1
0
mirror of synced 2024-11-27 22:40:49 +01:00

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.
This commit is contained in:
Viv 2023-06-02 16:33:42 -04:00
parent 0c95ff11f3
commit 3b2111ae31

View File

@ -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 # Seek forward 8 bytes to account for padding bytes at the end of drumrolls
if noteType == 0x6 or noteType == 0x9 or noteType == 0x62: 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 # Assign the note to the branch
branch[noteNumber] = note branch[noteNumber] = note
@ -356,7 +356,7 @@ def writeFumen(file, song):
noteStruct.append(note['durationPadding']) noteStruct.append(note['durationPadding'])
writeStruct(file, order, format_string="ififHHf", value_list=noteStruct) writeStruct(file, order, format_string="ififHHf", value_list=noteStruct)
if note['type'].lower() == "drumroll": if note['type'].lower() == "drumroll":
file.seek(0x8, os.SEEK_CUR) file.write(note['drumrollBytes'])
file.close() file.close()