One Islamic Hadith which seemingly is used to throw out musical melodies is:
3685. It was narrated from 'Abdullãh bin 'Amr that the Prophet of Allah forbade Khamr, gambling, A1-Kübaht1' and Ghubaira ,[21 and said: "All intoxicants are Harãm."
The context of these hadiths is showing alcohol was considered non kosher or haram, with many drinking before prayer time and thus approaching God in a state of drunkenness.
3672. It was narrated that Ibn 'Abbas said: "(The Verses) 0 you who believe! Approach not Salat (the prayer) while you are intoxicated"'
Debates went on and finally it was settled that alcohol was not permitted. Islam's opposition to alcohol follows the Jewish Essene tradition where they are also strict on ritual purity laws often immersing themselves in water(ritual bath) many times a day. In any case this hadith says that Al-Kübah, which is a musical drum, is forbidden. This has made many to think music was banned because this humble drum was not allowed to be used. Is it just the drum or music in general?
The drum was also a contention within Judaism. Believe it or not. It is likely this is one of the reasons why the drum ban was carried on within Islam.
From the article, Renewing Ecstatic Spirituality to the Beat of a Drum
Kehilat Hadar does not use drums in its services, Kaunfer said, not for spiritual reasons but for legal ones: There is a dispute among rabbinic authorities as to whether drums are “tunable instruments,” which may not be played on the Sabbath.
The question about drumming echoes a much older Jewish debate: whether prayer or study is the primary means to serve the Divine. This debate raged throughout the Talmud and medieval Judaism, but reached a fever pitch at the turn of the 19th century when it divided the ecstatic, prayer-oriented Hasidim and their opponents, the scholastic, study-oriented Mitnagdim. Though America’s Conservative movement is, historically, a descendant of the German Reform movement, it shares with the Mitnagdim a deep suspicion of the drumming, music and singing that are still commonplace in Hasidic (and neo-Hasidic) circles. For them, as for Schorsch, the “rhythmic beat of the drum” led to both a denigration of the more refined arts of scholarship and to an unseemly, undignified religious enthusiasm.
Certainly, within the Jewish tradition, there is ample support for each side — sometimes from the same source. For example, Maimonides, in the Mishneh Torah, writes that “[p]rophecy does not come from sadness or sloth, but from joy. Therefore the prophets had before them harp, drum, flute, and lyre so they could seek prophecy.” Yet Maimonides also praises the rational efforts of the philosophers, which requires not prophetic joy but intellectual refinement.
The Mishnah carries on the prohibition of wedding drums. Israel after escaping from the Egyptians sang the song of Moses. Miriam was dancing and singing using a drum.
The drum may have been forbidden during prayer time as this was the context of many of the preceding hadiths. Not necessarily a blanket ban of using the instrument which has formed part of much of Israel's heritage.