diff --git a/README.md b/README.md index ea31291..2a72047 100644 --- a/README.md +++ b/README.md @@ -123,15 +123,16 @@ _Not all options working now!_ --crepe_step_size unit is miliseconds >> ((default) is 10) [extra] - --hyphenation True|False >> ((default) is True) - --disable_separation True|False >> ((default) is False) + --hyphenation Disable automatic hyphenation > True|False >> ((default) is True) + --disable_separation Disable track separation > True|False >> ((default) is False) --disable_karaoke True|False >> ((default) is False) --ignore_audio True|False >> ((default) is False) --create_audio_chunks True|False >> ((default) is False) - --keep_cache True|False >> ((default) is False) - --plot True|False >> ((default) is False) + --keep_cache Keep cache folder after generation > True|False >> ((default) is False) + --plot Create a pitch plot > True|False >> ((default) is False) --format_version 0.3.0|1.0.0|1.1.0 >> ((default) is 1.0.0) --musescore_path path to MuseScore executable + --keep_numbers Transcribe numbers as digits and not words > True|False >> ((default) is False) [yt-dlp] --cookiefile File name where cookies should be read from diff --git a/src/modules/sheet.py b/src/modules/sheet.py index 4e209ca..8ad3a49 100644 --- a/src/modules/sheet.py +++ b/src/modules/sheet.py @@ -41,11 +41,18 @@ def create_sheet(midi_segments: list[MidiSegment], success = set_environment_variables(musescore_path) if not success: return - s = stream.Stream() - add_metadata_to_stream(s, media_info.artist, media_info.title, int(media_info.bpm)) - add_midi_segments_to_stream(s, midi_segments) - export_stream_to_pdf(s, os.path.join(output_folder_path, f"{filename}.pdf")) - move(os.path.join(output_folder_path, f"{filename}.musicxml"), os.path.join(cache_folder_path, f"{filename}.musicxml")) + + try: + s = stream.Stream() + add_metadata_to_stream(s, media_info.artist, media_info.title, int(media_info.bpm)) + add_midi_segments_to_stream(s, midi_segments) + export_stream_to_pdf(s, os.path.join(output_folder_path, f"{filename}.pdf")) + move(os.path.join(output_folder_path, f"{filename}.musicxml"), os.path.join(cache_folder_path, f"{filename}.musicxml")) + except Exception as e: + song_error = (f"{media_info.artist} - {media_info.title}") + print(f"{ULTRASINGER_HEAD} {red_highlighted('Error: Could not create sheet for')} {blue_highlighted(song_error)}") + print(f"\t{red_highlighted(f'Error: ->{e}')}") + return def round_to_nearest_quarter(number: float) -> float: return round(number * 4) / 4