This sketch uses the tone() command to play notes.
Usage:
tone([pin], [frequency]);
note \ frequency
c 262 Hz
d 294 Hz
e 330 Hz
f 349 Hz
g 392 Hz
a 440 Hz
b 494 Hz
C 523 Hz
Other useful commands:
noTone([pin]);
and,
delay([time_ms]);
For more information, see http://arduino.cc/en/Tutorial/Tone