mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-12-01 09:37:14 +09:00
Merge branch 'main' into Plot_volume
This commit is contained in:
commit
e98cac1a4e
6 files changed
+30
-17
No files matched your search
@@ -82,6 +82,7 @@ class TestCreateUltrastarTxt(unittest.TestCase):
|
||||
@staticmethod
|
||||
def default_values(default_ultrastar_class):
|
||||
expected_calls = [
|
||||
f"#{UltrastarTxtTag.VERSION}:{default_ultrastar_class.version}\n",
|
||||
f"#{UltrastarTxtTag.ARTIST}:{default_ultrastar_class.artist}\n",
|
||||
f"#{UltrastarTxtTag.TITLE}:{default_ultrastar_class.title}\n",
|
||||
f"#{UltrastarTxtTag.MP3}:{default_ultrastar_class.mp3}\n",
|
||||
@@ -89,7 +90,6 @@ class TestCreateUltrastarTxt(unittest.TestCase):
|
||||
f"#{UltrastarTxtTag.BPM}:390.0\n",
|
||||
f"#{UltrastarTxtTag.GAP}:500\n",
|
||||
f"#{UltrastarTxtTag.CREATOR}:{default_ultrastar_class.creator}\n",
|
||||
f"#{UltrastarTxtTag.FIXER}:{default_ultrastar_class.fixer}\n", # todo: fixer is special
|
||||
f"#{UltrastarTxtTag.COMMENT}:{default_ultrastar_class.comment}\n",
|
||||
": 0 52 1 UltraSinger \n",
|
||||
"- 52\n",
|
||||
@@ -103,6 +103,7 @@ class TestCreateUltrastarTxt(unittest.TestCase):
|
||||
@staticmethod
|
||||
def full_values(default_ultrastar_class):
|
||||
expected_calls = [
|
||||
f"#{UltrastarTxtTag.VERSION}:{default_ultrastar_class.version}\n",
|
||||
f"#{UltrastarTxtTag.ARTIST}:{default_ultrastar_class.artist}\n",
|
||||
f"#{UltrastarTxtTag.TITLE}:{default_ultrastar_class.title}\n",
|
||||
f"#{UltrastarTxtTag.YEAR}:{default_ultrastar_class.year}\n",
|
||||
@@ -114,7 +115,6 @@ class TestCreateUltrastarTxt(unittest.TestCase):
|
||||
f"#{UltrastarTxtTag.BPM}:390.0\n",
|
||||
f"#{UltrastarTxtTag.GAP}:500\n",
|
||||
f"#{UltrastarTxtTag.CREATOR}:{default_ultrastar_class.creator}\n",
|
||||
f"#{UltrastarTxtTag.FIXER}:{default_ultrastar_class.fixer}\n",
|
||||
f"#{UltrastarTxtTag.COMMENT}:{default_ultrastar_class.comment}\n",
|
||||
": 0 52 1 UltraSinger \n",
|
||||
"- 52\n",
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ scipy~=1.11.2
|
||||
tensorflow<2.11
|
||||
tqdm~=4.65.2
|
||||
whisperx~=3.1.1
|
||||
yt_dlp~=2023.7.6
|
||||
yt_dlp~=2023.9.24
|
||||
|
||||
isort~=5.12
|
||||
black~=23.3
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Settings:
|
||||
APP_VERSION = "0.0.1-2023-10-03"
|
||||
|
||||
create_midi = True
|
||||
create_plot = False
|
||||
create_audio_chunks = False
|
||||
|
||||
+3
-1
@@ -381,7 +381,7 @@ def run() -> None:
|
||||
is_audio, pitched_data, ultrastar_class, ultrastar_file_output
|
||||
)
|
||||
|
||||
# Add calculated score to Ultrastar txt
|
||||
# Add calculated score to Ultrastar txt #Todo: Missing Karaoke
|
||||
ultrastar_writer.add_score_to_ultrastar_txt(
|
||||
ultrastar_file_output, simple_score
|
||||
)
|
||||
@@ -540,6 +540,8 @@ def create_ultrastar_txt_from_automation(
|
||||
if os_helper.check_file_exists(os.path.join(song_output, cover))
|
||||
else None
|
||||
)
|
||||
ultrastar_header.creator = f"{ultrastar_header.creator} {Settings.APP_VERSION}"
|
||||
ultrastar_header.comment = f"{ultrastar_header.comment} {Settings.APP_VERSION}"
|
||||
|
||||
# Additional data
|
||||
if title is not None:
|
||||
|
||||
@@ -7,6 +7,7 @@ FILE_ENCODING = "utf-8"
|
||||
class UltrastarTxtTag(str, Enum):
|
||||
"""Tags for Ultrastar TXT files."""
|
||||
|
||||
VERSION = 'VERSION' # Version of the file format: See https://usdx.eu/format/
|
||||
ARTIST = 'ARTIST'
|
||||
TITLE = 'TITLE'
|
||||
MP3 = 'MP3'
|
||||
@@ -20,9 +21,6 @@ class UltrastarTxtTag(str, Enum):
|
||||
FILE_END = 'E'
|
||||
LINEBREAK = '-'
|
||||
|
||||
# Only used in UltraStar World Party
|
||||
FIXER = 'FIXER'
|
||||
|
||||
# Unused
|
||||
BACKGROUND = 'BACKGROUND' # Path to background. Is shown when there is no video. Should end with `*[BG].jpg`
|
||||
VIDEOGAP = 'VIDEOGAP'
|
||||
@@ -31,19 +29,32 @@ class UltrastarTxtTag(str, Enum):
|
||||
YEAR = 'YEAR'
|
||||
START = 'START'
|
||||
END = 'END'
|
||||
RESOLUTION = 'RESOLUTION' # Changes the grid resolution of the editor. Only for the editor and nothing for singing.
|
||||
NOTESGAP = 'NOTESGAP'
|
||||
RELATIVE = 'RELATIVE'
|
||||
ENCODING = 'ENCODING'
|
||||
PREVIEWSTART = 'PREVIEWSTART'
|
||||
MEDLEYSTARTBEAT = 'MEDLEYSTARTBEAT'
|
||||
MEDLEYENDBEAT = 'MEDLEYENDBEAT'
|
||||
CALCMEDLEY = 'CALCMEDLEY'
|
||||
DUETSINGERP1 = 'DUETSINGERP1'
|
||||
DUETSINGERP2 = 'DUETSINGERP2'
|
||||
P1 = 'P1' # Only for UltraStar Deluxe
|
||||
P2 = 'P2' # Only for UltraStar Deluxe
|
||||
|
||||
FIXER = 'FIXER' # Only used in UltraStar World Party
|
||||
|
||||
# (Unused) deprecated since 1.0.0
|
||||
DUETSINGERP1 = 'DUETSINGERP1'
|
||||
DUETSINGERP2 = 'DUETSINGERP2'
|
||||
RESOLUTION = 'RESOLUTION' # Changes the grid resolution of the editor. Only for the editor and nothing for singing.
|
||||
NOTESGAP = 'NOTESGAP'
|
||||
RELATIVE = 'RELATIVE'
|
||||
ENCODING = 'ENCODING'
|
||||
|
||||
# (Unused) New in 1.1.0
|
||||
AUDIO = 'AUDIO' # Its instead of MP3. Just renamed
|
||||
VOCALS = 'VOCALS' # Vocals only audio
|
||||
INSTRUMENTAL = 'INSTRUMENTAL' # Instrumental only audio
|
||||
ONLINE = 'ONLINE' # URL of the song/video online
|
||||
MUSICDB = 'MUSICDB' # ID or other of an online DB like musicbrainz
|
||||
DIFFICULTY = 'DIFFICULTY' # Difficulty of the song
|
||||
MEDLEYSTART = 'MEDLEYSTART' # Rename of MEDLEYSTARTBEAT
|
||||
MEDLEYEND = 'MEDLEYEND' # Renmame of MEDLEYENDBEAT
|
||||
|
||||
class UltrastarTxtNoteTypeTag(str, Enum):
|
||||
"""Note types for Ultrastar TXT files."""
|
||||
@@ -57,6 +68,7 @@ class UltrastarTxtNoteTypeTag(str, Enum):
|
||||
class UltrastarTxtValue:
|
||||
"""Vaules for Ultrastar TXT files."""
|
||||
|
||||
version = "1.0.0"
|
||||
artist = ""
|
||||
title = ""
|
||||
year = None
|
||||
@@ -76,6 +88,3 @@ class UltrastarTxtValue:
|
||||
pitches = []
|
||||
words = []
|
||||
noteType = [] # F, R, G, *, :
|
||||
|
||||
# Only used in UltraStar World Party
|
||||
fixer = "YOUR NAME"
|
||||
@@ -55,6 +55,7 @@ def create_ultrastar_txt_from_automation(
|
||||
with open(ultrastar_file_output, "w", encoding=FILE_ENCODING) as file:
|
||||
gap = transcribed_data[0].start
|
||||
|
||||
file.write(f"#{UltrastarTxtTag.VERSION}:{ultrastar_class.version}\n"),
|
||||
file.write(f"#{UltrastarTxtTag.ARTIST}:{ultrastar_class.artist}\n")
|
||||
file.write(f"#{UltrastarTxtTag.TITLE}:{ultrastar_class.title}\n")
|
||||
if ultrastar_class.year is not None:
|
||||
@@ -70,7 +71,6 @@ def create_ultrastar_txt_from_automation(
|
||||
file.write(f"#{UltrastarTxtTag.BPM}:{round(ultrastar_bpm, 2)}\n") # not the real BPM!
|
||||
file.write(f"#{UltrastarTxtTag.GAP}:{int(gap * 1000)}\n")
|
||||
file.write(f"#{UltrastarTxtTag.CREATOR}:{ultrastar_class.creator}\n")
|
||||
file.write(f"#{UltrastarTxtTag.FIXER}:{ultrastar_class.fixer}\n")
|
||||
file.write(f"#{UltrastarTxtTag.COMMENT}:{ultrastar_class.comment}\n")
|
||||
|
||||
# Write the singing part
|
||||
|
||||
Reference in new issue
Block a user