I'm working on a product using the General Midi capabilities of the VS1053b chip and I've run in to some latency issues.
I've designed a hardware module that takes both 5V gates from a modular synth system and hardware midi input to trigger the VS1053b's built in general midi synth. I've designed my own PCB and the VS1053b is set up in Real-Time MIDI mode. Everything works very well, however I have more latency than I expected.
I'm transmitting midi to the VS1053b via the hardware serial port of an Arduino Nano Every. I've measured the latency from the digital input on the arduino receiving a gate input, to the midi message output on the serial port with my oscilloscope and it's around 2-3 milliseconds. However, the time from a gate input into the Arduino until I get the first audio transient (using the midi ch. 10 drum sounds for instance) is around 13-15 milliseconds. So it seems the VS1053b is adding 10 or more milliseconds of latency. I measured the delay from the first flank of the midi message to sound output and that is 12-13 ms, so it checks out, it's the VS1053b that is adding all this latency. In normal circumstances using the chip as a standalone midi playback device, this latency does not matter. But in my application I'm triggering the sounds together with other modules in a modular synthesizer, and the difference in latency becomes noticable.
So, my question is if there is any way of reducing this latency in the chip? At this point I don't have any other means of programming the VS1053b implemented in my hardware, only the midi communication.
The VS1053b is clocked with a 12.288 MHz crystal. And I assume Earspeaker is turned off as I have put pull down resistors on GPIO 2 and 3.
Any help on this would be much appreciated.
