These two videos are a great demonstration of how coding and animation being used with music can produce some pretty cool stuff. The first is done by one guy for his masters thesis. He uses a software called Houdini, which is heavy on the programming but also includes animation software. For the entire thing he is manipulating a sine wave and he actually does everything including the music himself.
This next one is similar, it is all based of sounds of the instruments being played and used where they fell when viewed on an equalizer. Most of what occurs is simulated by the computer and only the original beats on the page are controlled.