Letâs assume there are two Midihubs (I actually have two of them in use right now).
The message they would send would be more to say âhey, I am now powered onâ. Something else might respond to it or it might be completely ignored. The Midihubs would stay ignorant about the true purpose of the startup message.
If you would have several Midihub presets used then the response could be a program change message followed by CC messages for the mappings.
In case you have several Midihubs, you would likely want to configure different startup messages so that whatever is responding knows what it should send.
When it comes to my Lua script on the Electra One, I donât have to know what preset is selected on the Midihub, I just need to know that it is powered on and ready.
It is assumed that the desired patch on the Midihub is compatible with the patch on the Electra One.
Once it is established that a Midihub is powered on, I can ignore itâs internal state and just reset it to something known to me. The caviat is that I really have to reset everything.
This would be dependent on my current setup but when I detect the startup message, I would send a PC message to make sure the Midihub is on the right patch.
Most of the time this would not do anything I suppose, since I only have one patch used but for the sake of completeness it has to be considered.
Once I establish that I know which patch is selected on the Midihub (and here I would make the assumption that if I send a PC message for a specific patch then that is what will be selected) I can start getting the mapped items into a known state, which I would do by setting them to the same value that they currently have on the Electra One.
This method can be scaled for several Midihubs with the use of different startup messages, or by reusing the same startup message and using unique CC messages across the different Midihubs.
After this point the two devices should be consistent with each other and remain that way as long as the MIDI communication is alive and there are no additional devices that change mapped values on the Midihub without also telling the Electra One about the change.