@Clemens and @Bavi_H thank you, I really appreciate your continuous posts. You all the time inspire me to try new things!
@Clemens.
- Yes its a RC-505 mkII. Have u read somewhere that the code stands for that?
- There were no button pressed, only turned the song knob forth & back fast. IF it should make sence somehow as a shortcut command to the last song when many song-data is sent, I would expect e.g. a distance/subtraction value from 14 to 27, so in this case if the value were 27-14=13 OR 27 then it would have made sence. But 65,16,114, 8 & 120 doesnt make any sence to me. But the definitions u have written above is that consequent rules for all SysEx?
- I have tried both with & without logging. Thats also why I made the easy logical setting "trace" in the beginning of the code, so I could test both with and without.
But I do have seen it fail also without the trace. But its a while ago and the code has changed since, so yes, would be smart to test it again.
@Bavi_H
- Ya I have noticed the jumps in milliseconds too. But Im not sure they are trustworthy! As it seems like all data are coming in chunks in that build in trace logging window of Arduino IDE. I have eralier experimented with timing also, both to log, but also to with purpose put in a wait until alle song changes were finish. I didnt have much success with that too. But it might make more sence now when the code is based on byte ranges! So I think first I need to program my own timer object again and post my own time in the log window, so we can check if it is a true long time the tftf wirting takes or if its just the IDE's chunks of data.
But of course the tft writing takes time no matter what. I have also bought some new & other types of tft's to test if they are faster.
- About the many commands and much writing to the tft, yes I have also simplified that a loot earlier. It helped a little, but still not 100% in all cases. But I will optimize that code again of course. BUT in fact I need to update 11 tft displays with different content! So I need a working base solution which doesnt get affected of how much is written, because else I will just have the problem again when adding 1 more or 2 or 5 or 11.
- About your last question in 1, what would happen would be for each writing the area on the screen would be more and more filled & blurred ending up just being a filled square.
- About your 2. question: tft.availableForWrite() isnt something I have found documented, but I also saw the serial.availableForWrite() and just thought that tft is also serial so it must be based on the same class, so I just tried it and it didnt fail. But I have also not seen it "go wrong" (not true) so I guess it doesnt make any difference if it is there or not. - But ya, I have tried MANY desperate things on my way to fix this. L
- I have also tried tft.flush() but it also didnt seem to solve it, also I have tried to disable other interrupts while writing to the tft with NoInterrupts() and interrupts() to reactivate, but this also didnt seem to fix it.
So ya, I will try my own timer and return to you.
I will also test without the trace and return.
But I really really would like to find the exact course of the problem! And not just "minimizing" by making things take a little longer and just reducing the propability of the lost datas. Becaus if we find the exact reaosn, we would probably also be able to dontrol it somehow.
I would prefer a solution with flush, buffer, ringbuffer, interrupts, better tft, better midi interpretation, pauses, or even using extra dedicated Arduinos or even other small computer devices as a solution where I can add so many tft displays and write so much as i want, without it looses data.