LUA & Patch Request

Hi @martin,

Quick question about LUA and Presets. If remember right I once asked about why the ‘Request Patch’ thingy is not automaticly triggered at Preset load time, and you replied that it indeed was not done automaticly, but would be a perfect case for LUA to fill the gap. How would I proceed, is there a way (in LUA) to ‘know’ the the exacte SysEx to fire (by say interrogating the Preset for this), or is that not possible and the LUA script should just fire the same SysEx?

Cheers, Joris

Hi @joris,

pls check the patch.requestAll () command. If you place it in setup part of the Lua script, it will be executed when the preset is loaded. It forces Electra to send out all Patch Requests defined in the preset, ie.the same action as if you pressed the [PATCH REQUEST] button.

Lua Extension - Patch

1 Like

Thanks @martin, yes, tried it. Upload the script with only that one line. It works immediate when uploading, but when I than change Preset (on the device), and later come back to the Preset (where I uploaded this script), it does not fire the request as I would expect. Do I miss something?

ahh, that is a good one. I will check.

never mind - solved it. Needed to define the patch response part properly in the JSON.
Now I see the on.Response() getting the sysex data

1 Like