MIDI controller, how to "refresh" MIDI CC values on request?

Hi!

Simply put I have made a hardware step sequencer controller with LEDs, 32 x 4 (Adafruit Trellis).
It works as expected, sending MIDI CC#0-127 (128 buttons) and receiving MIDI signals if something is changed in software, so the state is updated.

But one thing I can't figure out; Lets say I unplug and plug the controller back in, all the lights are off, and the controller assumes all the CC values are "0" (off), while in reality some are "127" (on).

If I click the ones that should be on, I have to click twice to turn off (first click = controller sends "on" because it believes it's off, next is "off", and then they are synchronized.

Is there ANY way I can fix this? F.ex. the Push controller, and some other controllers update their state, lights etc. to reflect the current setup in Ableton. How?!

I'd like to request that Ableton sends the current CC# values for all buttons 0-127 when I plug in my controller (Arduino Leonardo with MIDIUSB). The code could be under Setup, so it runs every time I start it up.

I have not found any way to do this. It would be a lifesaver as it's going to be used in a public space. Being able to reload/refresh the controller would save me so much potential trouble.

...I'm already having enough problems getting Ableton to stop messing up with CC#123 (all notes off/Stop)

I appreciate any input from you guys :slight_smile:

If I click the ones that should be on, I have to click twice to turn off (first click = controller sends "on" because it believes it's off, next is "off", and then they are synchronized.

Yes this is a common problem with keeping track of code and states. It stems from you assuming a relationship in the code.

To get round it when the controller starts up send CC messages to all controllers setting the initial values, do not assume they are all in an initial state.