That is very very old code, haha. Procssing loads an mp3 off the hard drive. It also looks at the Line In with in = minim.getLineIn. Basically I have two audio sources available to the program; the MP3 and the system's audio output (set in windows recording devices to Stereo Out). A fourier transform is then performed, converting the signal to frequency information. The information is stored in a vector in the form of the intensity each frequency band.
Firmata gives you direct control of the arduino live from your computer. arduino.analogWrite(pin, value) will give a pin a value.
r = 9; //stores the value of our Red output pin (must be PWM!)
bass = in.getfft(0); //not actual command, forgot what it is
arduino.analogWrite(r, bass);
This outputs red light according the first stored frequency band, which is of course very low bass. This usually needs to be amplified. I generally multiply my frequency variables by an exponential function to expand the lows and condense the highs for a more reactive light show. You may also want to apply a low pass filter so that you don't end up with seizure inducing light shows.