Midi cc constant streem

This is usually solved by using a digital low-pass filter in combination with hysteresis.
The Control Surface library I maintain supports this out of the box: GitHub - tttapa/Control-Surface: Arduino library for creating MIDI controllers and other MIDI devices.