responseID always zero

(disclaimer, I’m an amateur programmer, so fully expect this is pilot error)

So, my MKS-50 sends 3 different sysex dumps when you change a Patch on the unit. Annoyingly it doesn’t respond to any request sysex, so this is the only way you can get a dump.

The 3 dumps have different headers like this:

I’d like to be able to parse the patch names from two of the dumps using patch.onResponse, but I can’t seem to separate them because responseId always equals zero.

I did some simple code to test:

function patch.onResponse (device, responseId, sysexBlock)
local blockLength = sysexBlock:getLength()
print ("responseId = " … responseId)
print (“sysex message " … blockLength … " bytes long.”)

And the result is:

09:49:16.014 lua: responseId = 0.0
09:49:16.021 lua: sysex message 31.0 bytes long.
09:49:16.022 lua: responseId = 0.0
09:49:16.022 lua: sysex message 14.0 bytes long.
09:49:16.041 lua: responseId = 0.0
09:49:16.052 lua: sysex message 54.0 bytes long.

It’s obviously receiving all three dumps and triggering patch.onResponse three times, but the responseId is always the same.

NOTE: I tried having all three Responses under one single Message in the Device Settings / Messages pane, but that generated an identical result.

Any help is much appreciated.

why do you use patch.onResponse instead of the response you can add under the 3 different dump requests? Surely the headers of these 3 responses are also different from on another? And the parsing will be much easier. I mean , I expect the SysEx responses of an MKS-50 to be rather straightforward, not like an XV5080 or a TG77

Sure I parse the patch names from the dumps the easy way but I want to display them on screen everytime a dump is received which I have to do in LUA, and I can’t tell the dumps apart there. Unless I’m missing something?

You mean you want to show the patch name on your screen?

Exactly yes. And have the name change everytime a dump is received. Hence using onResponse.

I suppose I could tell the dumps apart by their length. But my understanding was that responseId was supposed to be a unique ID.

I have been rather busy recently. I will take a look at it tonight. Yes, the response Id should returned and it should be a unique ID identifying the sysex response message.

Thanks Martin. No rush!

ok, now I understand. The GUI editor does not have any input field for the response Id. So, currently, you can enter that manually to the JSON only:

I will adjust the editor accordingly later.

Aha! Thank you so much, Martin. I had assumed that the IDs were automatically assigned. Everything is working now. Cheers!