A small six pin processor is programmed with a melody to be played back through a piezo speaker. A lithium button cell provides the power and a leaf switch closes when the card is opened, turning the music on.
Step 1: The Circuit Diagram
The circuit is very simple and consists of just four components: the battery, microcontroller, piezo speaker and switch.
The switch (not shown in the diagram) is just two strips of metal pressed together, with a piece of paper in between. As the card is opened, the paper is pulled away and the two contact each other, thus closing the circuit.
A fragment of the code is shown, too. The program takes up 56 locations in memory. The PIC10F200 has 256 such locations available. A melody consisting of 200 notes or so can be fitted in to this chip.
This should be sufficient for a musical greeting card.