Closed thgcode closed 4 years ago
There is only one parameter that is adjustable, the number of buffers. I have made it 4, the same as in MidiFile.cpp, the code that plays midi files in android...
// The midi engine buffers are a bit small (128 frames), so we batch them up
static const int NUM_BUFFERS = 4;
I measured the latency a while ago – https://github.com/billthefarmer/mididriver/issues/12#issuecomment-142563372. It's about 23ms. I thought that was good enough.
Thank you very much for your reply. I'll try recompiling it with a smaller number of buffers to see if it helps. My problem is that I'm developing an app that needs to play the notes live got from a keyboard, so the faster it outputs audio the better.
Update: I reduced the number of buffers from 4 to 1 and recompiled the app again. Some of the delay remains, but now it is enough to get the notes almost instantly from the keyboard. Thank you again.
I'm trying to reduce the latency of mididriver on my application. I'm using the Java wrapper. It would be nice if you could add functions to modify the buffer size and the other parameters before the driver initializes.