Sending low latency signals to arduino synced to music

I'm setting up an LED strip light show synced to music.

I already have some beat detection software I wrote in Matlab as part of my signal processing studies. It works fairly well and gives me the exact times of beats in milliseconds (i.e., the time of the first beat and the space between successive beats).

Now I would like to send a signal to my arduino exactly on each beat so that it can change the lights. The songs will be playing on my computer through a media player (currently Matlab's built in player) so I can track the sample position and send the signals on the beats.

What is the best route of communication here? USB, Bluetooth? I need to minimize latency, or otherwise calibrate the latency so I can correct for it. Any advice on how to do this is welcome.

USB (Serial) should be fine as long as your not sending masses of data per beat but to be certain of this can you explain in more detail what LED strip your using and what your expecting to change on the beat. IE number of leds lit, colour of all leds, variable colours for each led etc.

Sure, the basic functionality has the computer sending the arduino a "beat pulse" on the edge of every beat. It might contain a bit more information, such as what type of pattern to display. Then the arduino updates the LEDs using the FastLED control library. For example, flash all the LED's red on the bet, or send a pulse of random color down the strip every beat. So all that I send is a couple bytes for the pulse.

Now I'm also wondering, say I want the volume of the song to control the color dynamically. I don't think I can store the volumes on the arduino at every point in the song. Would I be able to stream that information through serial? e.g. the song volume every 10ms. Should be 100 bytes a second so it seems doable, but this is very time sensitive. If there is latency is is predictable enough that I can calibrate it out?

If the timing of data transmission is important (down to the level of about 10ms), how well will the USB perform? If there is much latency, is it a reliable amount latency that I will be able to calibrate out?

To elaborate, say I just want to send one byte every 10 milliseconds. Will those arrive at the arduino serial input spaced by 10ms and will there be appreciable delay?

Effectively you are using a LED light strip as a substitute for a musical instrument that would normally be controlled via MIDI (at 31.25KHz).

To see what is realistically achievable, do a google search for "windows midi latency" or "mac os midi latency".

If the data is being sent by a Windows/Mac computer (as in your post about synchronising lights to music), then you are at the mercy of device drivers supplied by the non-real-time host operating system.

If you want precise timing then you need to use a real-time operating system or no operating system.

Do not croospost or repeat the same question it just piss off the people who give there free time to answer questions here.

Mark

Do not croospost or repeat the same question it just piss off the people who give there free time to answer questions here.

Mark