Add piano_soundfont patch

This commit is contained in:
augustin64 2024-10-13 23:43:06 +02:00
parent cdfb10502a
commit 31c7935a91

View File

@ -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)
outzip.writestr(inzipinfo.filename, data)