Incoming MIDI and TFT screen animations

phi

Member
Hello!
I’m playing around with various TFT screens, and really like the aesthetic of the round screens found on Amazon etc. I’m using 1.28” 240x240 GC9A01

I have a 16ch mux (but only 6 pots wired for now), a mpr121 touch breakout, a pcm5102 dac, and the tft screen all happily communicating on a teensy 4.1. I have usbHost and HW midi set up for testing as well.

I’m using a test animation that creates a number of rectangles and moves them around the screen, only updating the pixels that have changed. I used this tutorial:

https://bytesnbits.co.uk/basic-animation-spi-touchscreen/

When I’m just using the teensy, all controls are smooth and the animation runs smoothly. I can add 100 moving rectangles to the animation and there is no change to performance.

However, when I try to use incoming midi from usbHost or HW midi, midi notes hang, or are delayed and then all come at once. Commenting the animation out of the loop makes incoming midi work smoothly with no delay or hangs.

Can anyone point me in the right direction to find the bottleneck here? I know there are concepts like framebuffers, GFX canvas, and optimized libraries for screens like the ILI9341. I was spinning a 3D model on an ILI9341 with this library:
https://github.com/vindar/tgx
…so I know that smooth, complex animation is indeed possible. Is it a driver thing with the round screen? Conflict with the usb buffer? Fundamental flaw with the animation method? Any ideas or basic concepts are welcome, happy to post code if anyone is interested.

Best!
 
Have a look at the TeensyThreads library and put the display update code in a thread loop. I have a synth that updates the display this way and handles Midi and complex audio without noticable delay.
 
Oh, interesting! Definitely will give this a try.

The animations I’m making are closer to P5 generative art sketches, rather than data readout or text fields. The only library I’ve found with specific support and examples for the round screen is adafruit GFX, and my animations are mostly happy and flicker free using gfx canvas. Is there another optimized library that these round screens can use or I can dig into?

If the threads solve the midi hangs, happy to continue with canvas, but the optimizations here for example do sound useful:

https://github.com/PaulStoffregen/ST7735_t3

Apologies if this thread should have been in project guidance.
 
Back
Top