Hi mlu,
Codes are attached in a .zip in the first post.
However, I think you pointed me in a good way, thanks.
If we don't achieve to use a faster protocol (USB or something else), filter the incoming Midi data could the trick.
Actually, Ableton Live already avoid CC values repetition but I kept your code in case other software don't. Furthermore, I added a timing condition by declaring an "elapsedMillis CC_time[N_CHANNEL][N_CC]" and including a new statement in the if.
Code:
if (CC_value[channel][control] != value && CC_timer[channel][control] > CC_TIMEOUT) { /* only pass on changed values AND timeout overtaking */
Serial.print("Control Change, ch=");
Serial.print(channel, DEC);
Serial.print(", control=");
Serial.print(control, DEC);
Serial.print(", value=");
Serial.println(value, DEC);
CC_value[channel][control] = value; /* update current value */
CC_timer[channel][control] = 0; /*reset timer*/
}
I just tested the filtering tonight by printing CC values in serial monitor cause I don't have the whole hardware right now. I will tomorrow.
And all I can say for the moment is that is seems to work. Logically, the timing condition should make the code miss isolated values but I can't observe this phenomenon with relatively low CC_TIMEOUT setting (less than 10 ms).
I would be glad to hear from you if you see any mistaken or possible improvement.