Python script to reset the singger data of a svp file

import json

file_name = input('file name: ')

with open(f'{file_name}', encoding='utf-8') as f:
    line = f.readline()
    ri = line.rfind('}')
    line = line[:ri+1]
    data = json.loads(line)

    for track in data['tracks']:
        track['mainRef']['database']['name'] = ''
        track['mainRef']['database']['language'] = ''
        track['mainRef']['database']['phoneset'] = ''
        track['mainRef']['database']['languageOverride'] = ''
        track['mainRef']['database']['phonesetOverride'] = ''
        track['mainRef']['database']['backendType'] = ''

    with open(f'new_{file_name}', 'w', encoding='utf-8') as nf:
        json.dump(data, nf)

This is a temporary python script I made to use until the synth v crashing issue is fixed which fails to render the std library.

Works in Python 3.6 or later (f-string is used), resets the singger information of the svp file in the same directory.

When entering a file name, svp must also be entered.

2 Likes