Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ class Settings:
skip_cache_denoise_vocal_audio = False
skip_cache_transcription = False
skip_cache_pitch_detection = False
calculate_score = True
calculate_score = True
49 changes: 31 additions & 18 deletions src/UltraSinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,23 @@ def CreateUltraStarTxt(process_data: ProcessData):
if settings.create_karaoke and version.parse(settings.format_version.value) < version.parse(
FormatVersion.V1_1_0.value):
karaoke_output_path = os.path.join(settings.output_folder_path, process_data.basename + " [Karaoke].mp3")
convert_wav_to_mp3(process_data.process_data_paths.instrumental_audio_file_path, karaoke_output_path)

if process_data.process_data_paths.instrumental_audio_file_path:
convert_wav_to_mp3(process_data.process_data_paths.instrumental_audio_file_path, karaoke_output_path)
Comment on lines 399 to +404
Copy link

@coderabbitai coderabbitai bot Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Silent skip of karaoke conversion when instrumental is unavailable — user gets no feedback.

When --disable_separation is used, instrumental_audio_file_path is never set, so the karaoke MP3 is silently not created. The v1.1.0+ branch (line 413) prints a bypass message, but this older-format branch does not. Users expecting a karaoke file will be confused.

Proposed fix: add a similar bypass message
     if process_data.process_data_paths.instrumental_audio_file_path:
         convert_wav_to_mp3(process_data.process_data_paths.instrumental_audio_file_path, karaoke_output_path)
+    else:
+        print(f"{ULTRASINGER_HEAD} Skipping karaoke conversion (Bypass mode).")
🤖 Prompt for AI Agents
In `@src/UltraSinger.py` around lines 399 - 404, The karaoke conversion silently
skips when settings.create_karaoke is true but
process_data.process_data_paths.instrumental_audio_file_path is missing; add an
else branch after the existing if to emit the same bypass message used in the
v1.1.0+ branch (i.e., log/print that karaoke creation was skipped because no
instrumental audio was produced) so users see feedback for the
karaoke_output_path decision; reference the same variables used here
(settings.create_karaoke, FormatVersion.V1_1_0, karaoke_output_path,
process_data.process_data_paths.instrumental_audio_file_path,
convert_wav_to_mp3) and keep the message consistent with the newer-format
branch.

Copy link
Owner

@rakuri255 rakuri255 Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobUmf can you check this?
Maybe just use the given prompt for your ai

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!


if version.parse(settings.format_version.value) >= version.parse(FormatVersion.V1_1_0.value):
instrumental_output_path = os.path.join(settings.output_folder_path,
process_data.basename + " [Instrumental].mp3")
convert_wav_to_mp3(process_data.process_data_paths.instrumental_audio_file_path, instrumental_output_path)

if process_data.process_data_paths.instrumental_audio_file_path:
convert_wav_to_mp3(process_data.process_data_paths.instrumental_audio_file_path, instrumental_output_path)
else:
print(f"{ULTRASINGER_HEAD} Skipping instrumental conversion (Bypass mode).")

vocals_output_path = os.path.join(settings.output_folder_path, process_data.basename + " [Vocals].mp3")
convert_wav_to_mp3(process_data.process_data_paths.vocals_audio_file_path, vocals_output_path)
# Safety Check for Vocals
if process_data.process_data_paths.vocals_audio_file_path:
convert_wav_to_mp3(process_data.process_data_paths.vocals_audio_file_path, vocals_output_path)

# Create Ultrastar txt
if not settings.ignore_audio:
Expand Down Expand Up @@ -444,29 +453,30 @@ def CreateProcessAudio(process_data) -> str:
)
os_helper.create_folder(process_data.process_data_paths.cache_folder_path)

# Separate vocal from audio
audio_separation_folder_path = separate_vocal_from_audio(
process_data.process_data_paths.cache_folder_path,
process_data.process_data_paths.audio_output_file_path,
settings.use_separated_vocal,
settings.create_karaoke,
settings.pytorch_device,
settings.demucs_model,
settings.skip_cache_vocal_separation
)
process_data.process_data_paths.vocals_audio_file_path = os.path.join(audio_separation_folder_path, "vocals.wav")
process_data.process_data_paths.instrumental_audio_file_path = os.path.join(audio_separation_folder_path,
"no_vocals.wav")

if settings.use_separated_vocal:

audio_separation_folder_path = separate_vocal_from_audio(
process_data.process_data_paths.cache_folder_path,
process_data.process_data_paths.audio_output_file_path,
settings.use_separated_vocal,
settings.create_karaoke,
settings.pytorch_device,
settings.demucs_model,
settings.skip_cache_vocal_separation
)
process_data.process_data_paths.vocals_audio_file_path = os.path.join(audio_separation_folder_path, "vocals.wav")
process_data.process_data_paths.instrumental_audio_file_path = os.path.join(audio_separation_folder_path, "no_vocals.wav")

input_path = process_data.process_data_paths.vocals_audio_file_path

else:
input_path = process_data.process_data_paths.audio_output_file_path

# Denoise vocal audio
denoised_output_path = os.path.join(
process_data.process_data_paths.cache_folder_path, process_data.basename + "_denoised.wav"
)

denoise_vocal_audio(input_path, denoised_output_path, settings.skip_cache_denoise_vocal_audio)

# Convert to mono audio
Expand Down Expand Up @@ -691,6 +701,8 @@ def init_settings(argv: list[str]) -> Settings:
settings.keep_cache = True
elif opt in ("--musescore_path"):
settings.musescore_path = arg
elif opt in ("--cache_override_path"):
settings.cache_override_path = arg
#Addition of demucs model choice. Work seems to be needed to make sure syntax is same for models. Added error handling for unknown models
elif opt in ("--demucs"):
try:
Expand Down Expand Up @@ -741,6 +753,7 @@ def arg_options():
"format_version=",
"keep_cache",
"musescore_path=",
"cache_override_path=",
"keep_numbers",
"interactive",
"cookiefile=",
Expand Down