When defining patch.onRequest() to send a MIDI message when the PATCH REQUEST button is pressed, this message is sent three times in succesion. See attached screenshot.
With:
function patch.onRequest (device)
print ("Patch Request pressed");
midi.sendSysex(PORT_1, {0x00, 0x21, 0x45, 0x7E, 0x02, 5, 10})
end
I assume your preset has three devices used. That means that the function will be called three times, each time having different device reference passed as a parameter. It is actually correct behaviour. You can either use the device parameter to identify the request. Or, if you just want to sent a fixed SysEx message (like in your example), you can define that message on the Device :: Edit Patch :: Request:
A yes, the mixer preset uses three different MIDI channels and hence three different devices. That explains it and also explains that this is indeed intended behaviour. I already fixed it another way, but your suggestion is cleaner. Thanks.