From 9d7a4501afd26a92c93d9f284be3f80c51834d86 Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 3 Oct 2023 18:17:16 +0200 Subject: [PATCH 1/3] - Update to Foramt Version 1.0.0 - Remove special FIXER tag - Added Version --- .../UltraStar/test_ultrastar_writer.py | 4 +-- src/modules/Ultrastar/ultrastar_txt.py | 33 ++++++++++++------- src/modules/Ultrastar/ultrastar_writer.py | 2 +- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/pytest/modules/UltraStar/test_ultrastar_writer.py b/pytest/modules/UltraStar/test_ultrastar_writer.py index 4e82f4f..ae16a7f 100644 --- a/pytest/modules/UltraStar/test_ultrastar_writer.py +++ b/pytest/modules/UltraStar/test_ultrastar_writer.py @@ -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", diff --git a/src/modules/Ultrastar/ultrastar_txt.py b/src/modules/Ultrastar/ultrastar_txt.py index d22f91d..ca8ad98 100644 --- a/src/modules/Ultrastar/ultrastar_txt.py +++ b/src/modules/Ultrastar/ultrastar_txt.py @@ -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" diff --git a/src/modules/Ultrastar/ultrastar_writer.py b/src/modules/Ultrastar/ultrastar_writer.py index ecd616b..c375ae2 100644 --- a/src/modules/Ultrastar/ultrastar_writer.py +++ b/src/modules/Ultrastar/ultrastar_writer.py @@ -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 From 844e1748facb18dd115c09bdd2ba062dc0f089b5 Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 3 Oct 2023 18:35:49 +0200 Subject: [PATCH 2/3] - Added App Version --- src/Settings.py | 2 ++ src/UltraSinger.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Settings.py b/src/Settings.py index 6884d5d..7dbce20 100644 --- a/src/Settings.py +++ b/src/Settings.py @@ -1,4 +1,6 @@ class Settings: + APP_VERSION = "0.0.1-2023-10-03" + create_midi = True create_plot = False create_audio_chunks = False diff --git a/src/UltraSinger.py b/src/UltraSinger.py index 98375dc..c87a7a6 100644 --- a/src/UltraSinger.py +++ b/src/UltraSinger.py @@ -379,7 +379,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 ) @@ -538,6 +538,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: From 3ad8e8da1144b8f65dde35dfb97208333796e815 Mon Sep 17 00:00:00 2001 From: Vadim Date: Thu, 5 Oct 2023 14:21:45 +0200 Subject: [PATCH 3/3] - Update yt_dlp --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b939eb4..32da66e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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