The Shulchan Aruch · Orach Chayim
אורח חיים של״חOrach Chayim 338
Siman 338 of 697 in Orach Chayim — 8 se'ifim
הלכות שבתLaws of Shabbat· siman 338
Se’if 1א׳
הַשְׁמָעַת קוֹל בִּכְלֵי שִׁיר, אָסוּר, אֲבָל לְהַקִּישׁ עַל הַדֶּלֶת וְכַיּוֹצֵא בָּזֶה, כְּשֶׁאֵינוֹ דֶּרֶךְ שִׁיר, מֻתָּר. הַגָּה: וְכֵן אִם לֹא עָבִיד מַעֲשֶׂה, שָׁרֵי. וְלָכֵן אֵלּוּ שֶׁקּוֹרִין לְחַבְרֵיהֶם וּמְצַפְצְפִים בְּפִיהֶם כְּמוֹ צִפּוֹר, מֻתָּר לַעֲשׂוֹתוֹ בְּשַׁבָּת (הַגָּהוֹת אַלְפָסִי). וְאָסוּר לְהַכּוֹת בְּשַׁבָּת עַל הַדֶּלֶת בְּטַבַּעַת הַקָּבוּעַ בַּדֶּלֶת, אַף עַל פִּי שֶׁאֵינוֹ מְכַוֵּן לְשִׁיר, מִכָּל מָקוֹם הוֹאִיל וְהַכְּלִי מְיֻחָד לְכָךְ, אָסוּר. וְלָכֵן אָסוּר לְשַׁמָּשׁ לְהַכּוֹת עַל הַדֶּלֶת לִקְרֹא לְבֵית הַכְּנֶסֶת עַל יְדֵי הַכְּלִי הַמְיֻחָד לַכָּךְ, אֶלָּא מַכֶּה בְּיָדוֹ עַל הַדֶּלֶת (אָגוּר וּבֵית יוֹסֵף בְּשֵׁם פִּסְקֵי תּוֹסָפוֹת דְּעֵרוּבִין).
Producing noise from an instrument is forbidden, but knocking on the door or other things that are not musical are allowed. Rem"a: Similarly, if you do no action, it is allowed. Therefore, those who call their friends by making their mouths sound like birds are permitted to do such on Shabbat (Hagahot Alfasi). It is forbidden to bang on the door with the ring attached to the door, even though one has no musical intentions, because in any event, the ring is made especially for that purpose, and it is forbidden. Therefore, it is forbidden for the sexton to bang on the door to call the synagogue using a tool. Rather, he should bang with his hand (the Agur and Beit Yosef in the name of Piskei Tosafot in Eruvin).
Se’if 2ב׳
יֵשׁ מַתִּירִים לוֹמַר לְעַכּוּ"ם לְנַגֵּן בִּכְלֵי שִׁיר בְּחֻפּוֹת. הַגָּה: וַאֲפִלּוּ לוֹמַר לְעַכּוּ"ם לְתַקֵּן הַכְּלֵי שִׁיר, שָׁרֵי מִשּׁוּם כְּבוֹד חָתָן וְכַלָּה, אֲבָל בלא"ה, אָסוּר (מָרְדְּכַי פֶּרֶק מַשִּׁילִין). וּמִיהוּ בַּזְּמַן הַזֶּה נָהֲגוּ לְהָקֵל, מִטַּעַם שֶׁיִּתְבָּאֵר בסי' שֶׁאַחַר זֶה לְעִנְיַן טִפּוּחַ וְרִקּוּד.
There are some who permit telling a non-Jew to play an instrument at weddings. Rem"a: Even telling a non-Jew to fix the instrument is allowed because of the honor accorded to the groom and bride, but in other situations, this is forbidden (Mordechai in Perek Mashilin). However, in our times, we tend to be lenient with respect to clapping and dancing for a reason that will be explained in the next chapter.
Se’if 3ג׳
זוּג הַמְקַשְׁקֵשׁ לְשָׁעוֹת, עָשׂוּי עַל יְדֵי מִשְׁקָלוֹת, מֻתָּר לְעָרְכוֹ וְלַהֲכִינוֹ מִבְּעוֹד יוֹם כְּדֵי שֶׁיֵּלֵךְ וִיקַשְׁקֵשׁ כָּל הַשַּׁבָּת.
On Friday, it is permitted to hang a clock that will ring on Shabbat.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0
English: Shulchan Aruch, Wikisource, via Sefaria — CC BY-SA