The Rabbis enacted a prohibition against playing a musical instrument on Shabbat out of concern that the instrument might break, and one would then repair it, which would constitute an act of Shabbat desecration ("Makeh Be’patish"). This prohibition is mentioned and discussed by the Shulchan Aruch (Orah Haim 338). The Rabbis extended this prohibition to include any action that produces a musical sound, such as clapping, snapping or banging to the beat of a song.
However, this prohibition does not include making non-musical sounds on Shabbat. Thus, for example, on Yom Tob, when cooking is permissible, one may heat water in a kettle that whistles when the water boils. Since the whistling is not musical in any way, this is allowed. Additionally, one may set an alarm before Shabbat to wake him up on Shabbat morning. Even if the alarm has a melody, this is permitted because the individual’s intent is to be awakened by noise, and not to play music. Furthermore, the Hazan is allowed to bang on the Teba in the synagogue to call the congregation to attention. Since the noise produced is not musical, this is permissible. Another example is clapping for applause, which is allowed on Shabbat, since the noise is made to express respect and appreciation, and not for music.
A number of Poskim address the situation of one who wants to ring a bell that produces a melodious sound, or to gently clap one’s hands to a beat, in order to help an infant or an ill patient fall asleep. These Poskim allow such actions in this case, since they are done for the benefit of somebody who is ill – or for a young child, who is considered an "ill patient" in this respect – and the Sages did not apply their decree to situations of illness. Therefore, making a melodious sound to help a patient or young child sleep is permissible on Shabbat.
Summary: It is forbidden on Shabbat to play a musical instrument or to produce any musical sound, such as by banging, clapping or snapping to a melody. Non-musical noises, however, such as clapping for applause or banging on the table to catch people’s attention, are allowed. It is permissible to set an alarm before Shabbat for Shabbat morning, even if the alarm has a musical ring.