low latency sensor data for midi and / or other purposes

Hi

I did google this, found some discussions but none that actually answered the problem and they were mostly pretty old so...

I need to use motion sensors to generate midi signals for a project. I have a setup with a PIR 'Maxbotix Ultrasnonic Rangefinder' sonar sensor sending serial data to a Python app which in turn sends midi notes based on the data. It works pretty well, but there's a noticeable latency.

I know the latency isn't present on the board because I can trigger an LED with the sensor instantaneously. I also know that the latency doesn't come from the Python midi lib because printing the data shows the exact same latency as I hear through the synth.

Generally speaking, is there a way to get very low latency data from an arduino board to a PC / Mac? I have read that I can configure the board as a real midi source and physically wire it up to a normal midi interface, which I will try once the parts arrive. If that works then great, for this project.

But now I wonder about getting low latency data other than midi, ie a joystick or something. Or maybe I want to leverage the superior processing power of a PC to process or filter the data in some way that an arudino can't handle. Is there a better protocol?

Thanks in advance

AP

A PIR sensor has a built in low pass filter so it takes about half a second (or longer) to generate a signal after being triggered. Is this the delay you are seeing?

Thanks for replying.

This is where my noobieness is brought to the fore!

I did start with a PIR (bc new to sensors, didn't know what I need) but the problem I describe is actually with a 'Maxbotix Ultrasnonic Rangefinder.' My question is obviously totally wrong so I'm gonna edit it.

With that in mind, I did also do control tests with LED's and microswitches that show a very small but 'musically' noticeable latency between the Arduino receiving a signal and the Python serial interface registering that same signal.