From 31c7935a918e2adda18c9c7418ef920b521fb00e Mon Sep 17 00:00:00 2001 From: augustin64 Date: Sun, 13 Oct 2024 23:43:06 +0200 Subject: [PATCH] Add piano_soundfont patch --- src/modules/mscz.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/modules/mscz.py b/src/modules/mscz.py index 69fb5f6..afc68a0 100644 --- a/src/modules/mscz.py +++ b/src/modules/mscz.py @@ -92,7 +92,20 @@ def better_soundfont(data): for track in data["tracks"]: pass - return json.dump(data) + return json.dumps(data) + +@register_patch(filename="audiosettings.json") +def piano_soundfont(data): + data = json.loads(data) + + for track in data["tracks"]: + if track["instrumentId"] != "metronome": + track["in"]["resourceMeta"]["attributes"]["presetBank"] = "0" + track["in"]["resourceMeta"]["attributes"]["presetProgram"] = "0" + track["in"]["resourceMeta"]["attributes"]["presetName"] = "Grand Piano" + track["in"]["resourceMeta"]["id"] = "MS Basic\\0\\0" + + return json.dumps(data, indent=4) """ @@ -144,4 +157,4 @@ def apply(source, dest, patches): for func in patches_by_filename[inzipinfo.filename]: data = func(data) - outzip.writestr(inzipinfo.filename, data) \ No newline at end of file + outzip.writestr(inzipinfo.filename, data)