Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Incoming MIDI and TFT screen animations

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Posts
    15

    Incoming MIDI and TFT screen animations

    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-anima...i-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!

  2. #2
    Senior Member
    Join Date
    Apr 2019
    Posts
    194
    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.

  3. #3
    Junior Member
    Join Date
    Jul 2020
    Posts
    15
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •