Something that’s cropped up during the development of my ESP32 USB-Midi keyboard player, regarding writing to my TFT screen, using the TFT_eSPI library.
I’ve introduced a new “Sequence” function, which automatically plays a series of chords / notes.
As the player moves through a song, it updates the screen, with information about the chord(s) being played.
Manually stepping through a chord chain is fine.
But NOW, the new sequence function highlights that the time spent writing data to the TFT screen affects the timing of the music. I never thought about it before, but it seems obvious to me now.
So, when regularly updating the TFT screen (at many different places on screen), which is quicker ? …
- Draw a rectangle to cover OLD text, then draw NEW text.
- Draw NEW text with BLACK background, to cover OLD text (needs trailing spaces,
to ensure OLD text gets covered).
I’m using method 1 and I have proven that making the rectangles as small as possible, is actually quicker.
There are various issues that make method 2 awkward, in certain places on the screen.
I don’t know how to find the answer to my question scientifically, so I’m just doing some experiments, but it’s a labourious, long-winded process.
Any scientific knowledge would be helpful please.
Thank you
Trevor