Music in Islam: The mathematical origin of melodic tones
"A group of scholars comprehended the prohibition of music from the hadith of the Messenger of Allah [peace and blessings be upon him] in which he says: “There will be [at some future time] people from my Ummah [nation] who will seek to make lawful the following matters: fornication, the wearing of silk, alcohol drinking and the use of musical instruments” [included by Bukhari]
However, Ibn Hazm said that this does not mean the prohibition of musical instruments and that the Prophet was talking about the social features of the spread of corruption which may accompany some instrumentalists or artists .
Fornication [Allah forbids], wearing silk, drinking alcohol, singing and musical instruments are the concomitant features of the licentious night. But this does not mean that all what the Prophet has mentioned is prohibited or an ingredient of prohibition.
The mere association between one matter and another is not an evidence that they both share the same legal ruling. Therefore, when the Prophet [peace and blessings be upon him] mentions something which is prohibited and associates another thing with it, it does not mean that the second matter is also prohibited. Same goes for mentioning an obligatory matter and associating another matter with it, this does not mean that the second matter is also obligatory. Allah the Almighty says: “Indeed, Allah orders justice and good conduct and giving to relatives”. Justice is an obligatory matter whereas good conduct and giving to relatives are recommended matters. Based on this, the obligatory matter is associated with the recommended matter and thus association between two matters does not indicate that both matters share the same legal ruling.
Therefore, the hadith which associates between fornication, drinking alcohol, wearing silk and using musical instruments does not indicate an obligatory association between all these matters but carries within its fold the potentiality of carrying out prohibited acts. The renowned scholars Abdul-Ghani al-Nabulsi, Imam al-Ghazali, Ibn al-Qaisarani and Ibn Hazm stated that music is a sound if it is beautiful, it is good and if it is ugly, it is bad.
Moreover, music is a natural disposition to which our souls are inclined. Therefore, it is good when the soul finds its comfort in and it is bad when it disturbs the human soul. Therefore for Muslim scholars, music is one of the mathematical sciences and we have seen the scholars’ opinions that its good is permitted and its bad is impermissible. Therefore, we have seen Muslims throughout history playing these instruments.
To the extent that Sheikh al-Islam Hassan al-‘Attar has said in the first third of the 19th century that a person who listens to strings tone accompanied by water murmur and the view of trees without being affected is a donkey."