-
-
Notifications
You must be signed in to change notification settings - Fork 64
disable_separation and Safety Check #295
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
base: main
Are you sure you want to change the base?
Changes from 19 commits
3dd55e7
3ad834d
2e36408
60c9b54
3b3893d
3fe421a
92306a7
554d543
c2a81f9
5bbd60a
623f1cd
2386ce4
7c70f93
08ca61a
1291a79
1efc8d1
3fe132e
c0cf7ef
0ecb206
3f072ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Silent skip of karaoke conversion when instrumental is unavailable — user gets no feedback. When 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
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @RobUmf can you check this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| 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: | ||
|
|
@@ -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 | ||
|
|
@@ -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: | ||
|
|
@@ -741,6 +753,7 @@ def arg_options(): | |
| "format_version=", | ||
| "keep_cache", | ||
| "musescore_path=", | ||
| "cache_override_path=", | ||
| "keep_numbers", | ||
| "interactive", | ||
| "cookiefile=", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.