The gemara says that according to Ulah it is forbidden to knock on a door on Shabbos because it is a violation of making noise. Rabba argued and held that it is permitted because only when it is done for the purpose of song is it forbidden. Even according to Rabba, it is not only actual music which is a problem because the gemara indicates that even the sound of water drops at a consistent rhythm that would tend to put someone to sleep is forbidden according to everyone. Therefore, Rashi explains that anytime the sound is soft and consistent - כעין שיר בנעימה ובנחת, it is assur.
Tosafos quotes a machlokes between Rabbeinu Chananel and the Ri"f whether we pasken like Ulah that any sound is forbidden, or like Rabba that only with a rhythm and beat would it be assur. Shulchan Aruch (338:1) paskens like the more lenient opinion and therefore permits one to knock on a door for the purpose of gaining entry since it is not at all similar to a song. However, the definition of shir is open to include even very minor forms of song. The Shulchan Aruch (339:3) writes that it is forbidden to clap or bang or rattle a nut to quiet down a child because of a gezeria שמא יתקן כלי שיר. Even the consistent sound of a rattle would be included in shir. It seems that the type of sound that we don't consider to be a shir is when it's done for the purpose of getting attention, rather than for the enjoyment of the sound.
The Biur Halacha (338: d.h. aval) cites the Gr"a who holds based on the Yerushalmi like Rabbeinu Chananel who follows the opinion of Ulah and forbids any form of noise making. The Biur Halacha points out that even according to the Gr"a who would forbid one to knock on a door on shabbos, would permit it if it were done כלאחר יד. The Shulchan Aruch (339:3) writes that even when clapping for music would be permitted if done כלאחר יד, therefore even if we are going to be machmir with making any noise, it would at least be permitted if it were done כלאחר יד even though it is being done for the purpose of making noise. However, the Biur Halacha himself (339) questions this heter of כלאחר יד and limits it to specifically clapping, but would not allow other forms of rhythms even if done כלאחר יד. Therefore, it isn't so clear why he assumes that the Gr"a would permit knocking on a door when done כלאחר יד since the entire heter may only apply to clapping. Apparently, any form of noise that one produces through clapping or banging is included in the heter of כלאחר יד. Based on this, one who bangs on a table to create a beat, if done כלאחר יד would be permitted (according to the shulchan aruch, but obviously not according to the Gr"a).
The Rama introduces a new chumrah. Although when not done for music or a rhythm he agrees with the Shulchan Aruch that it's permitted, if it is being done through a kli that is designed to make noise, even not a rhythmic noise, it is forbidden. Based on this the Rama holds that it is forbidden to use a door knocker on shabbos. The Mishna Berura quotes from the Beis Yosef that the rationale is that when noise is made with a kli that is designated for that purpose we're concerned that maybe he will intend to make music. The Biur Halacha points out that the Rambam in the pirush hamishnah permits the use of door knockers, not like the Rama. The Rambam writes:
והקול הנשמע לגלגל בעת השאיבה אין אוסרים אותו, וכמו כן אין אוסרין להקיש בשלשלת הפתחים והדומה להם, אבל מה שהוא אסור מן הקולות אינו אלא מה שהוא כקול של שיר, כלומר שיהיה לו נעימות על הסדר, והוא אמרם לא אמרו אלא בקול של שיר בלבד
However, it is not clear to me that the Rambam is permitting door knockers that are made specifically for the purpose of noise. Perhaps he is only permitting the rattling of a chain that was fixed to the door for the purpose of locking the door. How does the Biur Halacha know that the Rambam means to even permit a kli that is designated for the purpose of making noise?