Skip to content

fix: apply SEVOL: instead of SONGVOL: to hitsounds #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions tja2osu.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def cleanlist(start:list, dat:list):
offset = 0
off_k = 0
songvol = 100
sevol = 100
sevol_scaled = 100
measure = 4/4
changed = False
glock = False
Expand Down Expand Up @@ -132,7 +134,7 @@ def cleanlist(start:list, dat:list):
]
general = general_k
def convertio(filein, artist, creator, fileout):
global title, general, data_s, ChangingPoints, general_k, crop, delay_list, delay_list1, get, timec, scroll, version, bpm_k, glock, timep, lasted, tear, bpm, shou, offset, off_k, changed, measure, songvol, gogo
global title, general, data_s, ChangingPoints, general_k, crop, delay_list, delay_list1, get, timec, scroll, version, bpm_k, glock, timep, lasted, tear, bpm, shou, offset, off_k, changed, measure, songvol, sevol, sevol_scaled, gogo
artist = artist
creator = creator
with open(filein, encoding="cp932", errors='ignore')as inp:
Expand All @@ -156,7 +158,11 @@ def convertio(filein, artist, creator, fileout):
offset = -1000 * float(block[1].rstrip())
off_k = offset
elif block[0] == "SONGVOL":
songvol = int(block[1].rstrip())
songvol = float(block[1].rstrip())
sevol_scaled = round(min(100, 100 * sevol / max(1, songvol)))
elif block[0] == "SEVOL":
sevol = float(block[1].rstrip())
sevol_scaled = round(min(100, 100 * sevol / max(1, songvol)))
elif block[0] == "COURSE":
if block[1].rstrip() == "Easy" or block[1].rstrip() == "0":
version = "Kantan"
Expand All @@ -173,13 +179,13 @@ def convertio(filein, artist, creator, fileout):
line = inp.readline()
ChangingPoints.append([offset, bpm, scroll])
line = inp.readline()
data_s=[offset, timep, gogo, songvol]
data_s=[offset, timep, gogo, sevol_scaled]
while line.rstrip() != "#END":
if line[0] == "#":
block = line.split(" ")
if block[0].rstrip() == "#BPMCHANGE":
if changed:
data_k.append([get.rstrip(","), offset, timep, gogo, songvol, bpm, scroll])
data_k.append([get.rstrip(","), offset, timep, gogo, sevol_scaled, bpm, scroll])
changed = False
else:
changed = True
Expand All @@ -203,7 +209,7 @@ def convertio(filein, artist, creator, fileout):
shou = 60000/bpm*4*measure
elif block[0].rstrip() == "#SCROLL":
if changed:
data_k.append([get.rstrip(","), offset, timep, gogo, songvol, bpm, scroll])
data_k.append([get.rstrip(","), offset, timep, gogo, sevol_scaled, bpm, scroll])
changed = False
else:
changed = True
Expand All @@ -216,7 +222,7 @@ def convertio(filein, artist, creator, fileout):
offset += 1000*float(block[1].rstrip())
elif line.startswith("//") is False:
if glock:
data_k.append([get.rstrip(","), offset, timep, gogo, songvol, bpm, scroll])
data_k.append([get.rstrip(","), offset, timep, gogo, sevol_scaled, bpm, scroll])
changed = False
glock = False
if line.rstrip("\n") == ",":
Expand Down