This is probably a good starting point:
Syncing LED Lights to Playing Music
Not tried it my self though.