sound to light

can any body advise, I have all the parts in this link, but would like to know if I can get the sound direct from laptop either to this unit or in to arduino and still use the sketch as is

I have all the parts in this link, but would like to know if I can get the sound direct from laptop either to this unit...

No. There is no (electrical) analog input on the sound-sensor board.

...or in to arduino

Yes. With a simple circuit addition, you can run the headphone/line-output into an analog input. You need to [u]bias[/u] the Arduino's analog input. The Arduino can be DAMAGED by negative voltages, including the negative half of an AC waveform. And/or the signal can be "damaged" (distorted). The bias keeps the Arduino input from seeing negative voltages (as long as the signal doesn't swing more than 5V peak-to-peak, which a normal headphone or line-level audio signal won't).

The two equal-value resistors bias the input at half the supply voltage. So with no sound the ADC should read about 512. The 10uF capacitor isolates the DC from the sound source, while letting the AC signal through. (You can leave out the 47nF capacitor.)

You may not get exactly 512 with silence because of resistor tolerance (and there may be some analog noise).

and still use the sketch as is

That software is OK as a starting point, but there are a couple of things I'd change...

Subtract-out the 512 bias from sensorreading, and then take the absolute value (so the negative half of the waveform can trigger the LEDs.)

With the 512 bias subtracted and silence now reading (about) zero, you'll need to lower the threshold from what's shown in the sketch.

Another "popular" enhancement is to read the waveform in a ~50 millisecond loop so you can "catch" the waveform peak. That might be a bit tricky for a beginner because you have to use the Blink Without Delay Example method for timing. And, you have to find & save the positive or negative peak. ...As you may know, an AC waveform is continuously varying and it crosses through zero twice per cycle... That means the LED will be off much of the time and you won't see full brightness unless you use something like the 50ms peak reading "trick".

For my sound activated lighting effects, I use a moving average (or a moving average of the peaks) as demonstrated in the Smoothing Example. By taking a 20-second moving average, the effect can automatically adjust to volume changes. For example, one of my simplest effects turns the lights on when the signal is above average and off when it's below average.

P.S.

if I can get the sound direct from laptop

Of course, plugging into your headphone jack will usually turn-off your laptop's speakers so you'll need a [u]Y-Adapter[/u] (AKA "splitter") to connect external speakers or headphones if you want to hear the sound and activate the LEDs at the same time.

P.P.S.
As a simpler starting-point you can use the Pin-13 LED on your Arduino board before adding external LEDs (or lights, etc.).

Have you checked this out?

It does all the work and even splits the audio into 7 bands based on frequency (from low (bass) to high (treble)), so you can make the lights only react to the low bass, where the beat usually is determind.

I use this with some simple MOSFET transistors to get a 5 meter long LED strip to light up in a distinct colour in sync with the beat. In a car...

Here is some examples: link