Reduce MIDI latency?

Hi,
MIDI data passing MIDI In > PureData > MIDI out gets delayed by about 35ms. Where does the latency get introduced, and is it possible to reduce this somehow?

Hey, how did you meassure the latency?

I used Roland Studio Capture connected to my laptop to measure the latency. When this interface’s MIDI IN is looped directly to OUT, I get 3ms latency.

With Pisound added to the loop, and it’s MIDI ports connected to each other in software (aconnect 16:0 16:0), I get 5ms total latency, that means 2ms was spent within RPi / Pisound.

With a simple patch on Pure Data which imitates what aconnect above did:

[midiin]
|      \
[midiout]

I get 10ms total latency, so PD itself seems to add about 5ms…

I’m not sure whether there’s any settings available to improve this on PD. Launching PD with no GUI does not improve it.

i think pd links ‘control rate’ processing to audio processing, so perhaps if you reduce the audio buf size?

Ok, I tried agin using only objects midiin > midiout, and got a similar result to you, 2.5ms latency within RPi/Pisound, and 7.5ms within Pure Data, total 10ms. However if i change my patch to

ctlin > ctlout
or
notein > noteout

I get a latency within pure data of 29ms, So it seems if i use those objects rather that midiin and midiout the latency of puredata is quadrupled…

1 Like

So it looks like i can eliminate this extra latency in some midi objects by setting audio delay to 0ms in audio settings. Not sure why…

1 Like

Was just noticing the midi latency today too and went to the forum for help and found your comment.

Thanks!

Will try changing the delay too and see what happens :slight_smile:

1 Like