How easily change SysEx headers in multiple controls at once?

Hi, what would be the easiest way to perform a global “find and replace” in a preset?
I need to replace a part of a Sysex string in hundreds of controls to another string in order to make the preset compatible with another model of the some (Korg) brand.

I thought to download the preset as a preset (.epr format) or as a project (.eproj) and then perform a “replace all” via Notepad for instance and upload the result again, but I’m unfamiliar with these formats, let alone know if I could bring this operation to a good end.

My solution was to open the LUA code, Ctrl-A, Ctrl-C, and paste it into Notepad/Wordpad/TextEdit, do the changes there, then cut and paste the whole thing back into the Electra environment.

Bonus points for saving the original before making the changes

EDIT - if it’s all in the JSON, you can pull down the EPR, pretty print it, then do the substitution in an editor, then unminify it and send it back up. Not exactly sure what happens on the re-upload; whether the Electra environment considers that a new preset or not.

Not sure that would work. The Sysex string I want to replace is defined within each SysEx control, not in the LUA. So unless there is a way to export all the jsons from within each control into LUA, that wouldn’t do the trick.

Outlook voor Android downloaden

If you’re comfortable with unix shells, sed or similar should do the trick (if the inputs are text files, like json .epr)

yeah, sorry - you must have responded as I was editing my reply.
Dealing with the entire epr or eproj as a mega text file is the only way.

The reason I suggested pretty-printing it first is to maybe make the substitutions you need to do easier.

1 Like

What is interesting too is to use zerobrane studio for pasting all or snippets of code. It allows a secondary program to interpret the LUA

Outlook voor Android downloaden

I’m not afraid to uae notepad or the likes to change strings. But what format should I use .epr? .eproj? In other words what’s the best format to import back into Electra? And is this importing as a new Preset or importing into an existing preset? Moreover, does it change the ID’s of controls?

1 Like

it is better to edit the project file (.eproj). It is a file that the editor works with and the preset is generated out of that project. If you edit and import the preset file, editor will internally convert that to a project anyways.

I would suggest to make the edits and import as a new project. Check if everything is ok. If it is, you can import the same file as a new project revision later.

When using the project file, the IDs will stay unchanged.

before importing modified version check if the JSON is valid. eg. https://jsonformatter.curiousconcept.com is a good validator.

1 Like