What exactly causes the sound of a heart beat?

What causes the heart sounds

The sound popularly known as the "heart beat" is not caused by the contraction of the heart muscle itself but by the closing of the heart valves by the impact of blood pumped by the heart chambers.

The sound of the heart beat can be divided into two sounds (lub-dub). The first "lub" is caused by the closing of the mitral and tricuspid valves. The second "dub" is caused by the closure of the aortic and pulmonary valves.