From 18dea857b5d22b94f9d034ba9cc45b0c20a907e9 Mon Sep 17 00:00:00 2001 From: Alex Spangher Date: Thu, 7 Mar 2024 15:00:29 -0800 Subject: [PATCH 1/2] e --- aria/utils.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/aria/utils.py b/aria/utils.py index 94d4bd8..9745a17 100644 --- a/aria/utils.py +++ b/aria/utils.py @@ -7,12 +7,11 @@ from pydub import AudioSegment + def midi_to_audio(mid_path: str, soundfont_path: str | None = None): - SOUNDFONT_PATH = os.path.join( - os.path.dirname(__file__), - "..", - "fluidsynth/DoreMarkYamahaS6-v1.6.sf2", - ) + here = os.path.dirname(__file__) + FLUIDSYNTH_DIR = os.path.join(here, "..", "fluidsynth") + SOUNDFONT_PATH = os.path.join(here, "..", "DoreMarkYamahaS6-v1.6.sf2") DOWNLOAD_URL = "https://www.dropbox.com/scl/fi/t8gou8stesm42sc559nzu/DoreMarkYamahaS6-v1.6.sf2?rlkey=28ecl63kkjjmwxrkd6hnzsq8f&dl=1" if os.name != "posix": @@ -24,8 +23,8 @@ def midi_to_audio(mid_path: str, soundfont_path: str | None = None): "fluidsynth soundfont missing, type Y to download and continue: " ) if _input == "Y": - if not os.path.isdir("fluidsynth"): - os.mkdir("fluidsynth") + if not os.path.isdir(FLUIDSYNTH_DIR): + os.mkdir(FLUIDSYNTH_DIR) res = requests.get(url=DOWNLOAD_URL) if res.status_code == 200: From 9da2250eae575512918a3241b0c5a3afc1a8257a Mon Sep 17 00:00:00 2001 From: Alex Spangher Date: Thu, 7 Mar 2024 15:13:03 -0800 Subject: [PATCH 2/2] fix --- aria/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aria/utils.py b/aria/utils.py index 9745a17..696a2dc 100644 --- a/aria/utils.py +++ b/aria/utils.py @@ -11,7 +11,7 @@ def midi_to_audio(mid_path: str, soundfont_path: str | None = None): here = os.path.dirname(__file__) FLUIDSYNTH_DIR = os.path.join(here, "..", "fluidsynth") - SOUNDFONT_PATH = os.path.join(here, "..", "DoreMarkYamahaS6-v1.6.sf2") + SOUNDFONT_PATH = os.path.join(FLUIDSYNTH_DIR, "DoreMarkYamahaS6-v1.6.sf2") DOWNLOAD_URL = "https://www.dropbox.com/scl/fi/t8gou8stesm42sc559nzu/DoreMarkYamahaS6-v1.6.sf2?rlkey=28ecl63kkjjmwxrkd6hnzsq8f&dl=1" if os.name != "posix": @@ -24,6 +24,7 @@ def midi_to_audio(mid_path: str, soundfont_path: str | None = None): ) if _input == "Y": if not os.path.isdir(FLUIDSYNTH_DIR): + print(f"making dir: {FLUIDSYNTH_DIR}") os.mkdir(FLUIDSYNTH_DIR) res = requests.get(url=DOWNLOAD_URL)