To understand the working first have a look on the pin configuration of IC
1. Pin 1 is known as TSP - In normal operation this pin is left open.
2. Pin 2 is known as CE - To enable the IC it is connected to power supply and to disable the chip it is connected to ground.
3. Pin 3 known as LP - Only one song is played if connected to supply and all song play if connected to ground.
4. Pin 4 known as SL - On every positive going edge it will change the song.
5. Pin 5 known as AS - If you want to repeat the song connect it to power supply otherwise connect it to ground.
6.Pin 6 is known as NC - Means no connection.
7. Pin 7 known as ENV - This pin should be grounded.
8. Pin 8 known as ground.
9. Pin 9 known as MTO - Used as modulated tone digital output.
10. Pin 10 and 11 are known as OP1 and OP2 - Used as preamplifier for output.
11. Pin 12 known as MT1 - Used to provide modulated input signal to pre amplifier.
12. Pin 14, pin 15 and 13 known as OSC2 and OSC1 - Use as external oscillator.
13. Pin 16 is for power supply.
So from above you can now connect the pin according to your requirement means you want to play all songs or one song, or you want to stop at any song or you want to repeat any song. You can also use below table to select the pin configuration -

Fig. 2: Pin Configuration Of IC
Assemble the circuit properly and apply power supply. When a visitor comes on door and presses the switch S1 power supply is provided to base of transistor T5 which start conducting. Because of that transistor T3 also start conducting and make the transistor T4 also in conduction mode. This will provide the power supply to IC1 pin 4 and every time when 4 receive a low to high input it will change the song. Pin 5 is known as AS pin if this pin is high than only melody is repeated otherwise it will stop sounding. In short we have connected the IC in mode number 6 (refer to table above).
We have used transistor T1 and T2 to amplify the sound and intensity of sound can be varied with the help of VR1 connected at pin 9.
You can also used M3481and m3485 IC which produce 8 and 5 different songs respectively.