Hi and welcome to the Bome community!
Well building this for you would be beyond the scope of free support but I can advise of the strategy I would take.
I would use two global variables to bit map the state of each LED. I assume they only have 2 states as on=flashing and off=solid. I’m not sure what you want to do with those that have an off state. To update the LED’s I would create a timer that looks at the bit of each global variable to determine if it has an on or off state. The output would control the color of the LED similar to how you have it in your second translator.
For controlling the state, I would put logic to separate things in zones. Zones are based on the colors you want to map. When you press a button in the given zone, we extract the current bits in that zone, and set the bit that you pushed to a 1 and set all other bits in that zone to a 0 and then put the bits back into the original bitmap. Then let your update LED timer, handle the rest.
For the red zone, the routine would be different. You just toggle the button value that you pushed.
So you have separate logic for manipulating the bits based on what you pushed from the logic that refreshes the display.
zone 0 - red is 0-3
zone 1- blue is 4-7
zone 2 - off is 8-15
zone 3 - yellow 16-20
zone 4 - off 21-23
zone 5 - pink 24-27
zone 6 - off - 28-31
zone 7 - yellow green - 32-34
zone 8 - off - 35-36
zone 9 - green - 37-39
zone 10 - orange - 40-47
zone 11 - cyan - 48-51
zone 12 - orange - 52-55
zone 13 - cyan - 56-63
What I’m not sure of is whether you want zones with the same color to work together or whether they are separate zones. For instance I don’t know if the cyan or orange zones should be treated as one zone or two for purpose of exclusivity of flashing lights.
Also, I’m not sure how you want to treat the zones that are off.
Finally, I’m not sure what MIDI you will actual want to send to the application based on either button push or refresh of LEDs.
If you want me to build this for your as a paid engagement, please reach out to me via direct message or email.
Steve Caldwell
Bome Customer Care
Also available for paid consulting services: bome@sniz.biz