Replies: 1 comment 4 replies
-
As far as I know, the timing information is provided by the MIDI interface driver from the hardware if available or using a system timer. If you need to have the lowest latency possible for a "live" application, I believe that you're already using the best method: the callback.
Since you're using a callback, you're not polling! |
Beta Was this translation helpful? Give feedback.
-
Hi,
First off, thanks for building mido!
I'm building a looper which receives input via MIDI, and I've been using mido for that portion of it.
Next to just looping recordings, I also have functionality to trigger samples.
I was wondering what was the lowest-latency way of going from generating a MIDI signal to acting on it programmatically?
Currently I'm using RtMidi and a callback, and I think there is a stochastic delay somewhere on the order of <2ms (this is pure conjecture based on visually identifying the moment I pressed a key to generate a MIDI event on an audio waveform, and plotting when the program received the event).
I already
ports.set_sleep_time(0)
, which I believe in theory should allow MIDI polling as quickly as the system can interrupt (meaning switching to a PREEMPT_RT or similar kernel supposedly would reduce this latency).I want to implement as-accurate-as-possible timing in my application, so any pointers to where I can read more about this would be welcome!
Beta Was this translation helpful? Give feedback.
All reactions