SHAFAQNA – The Grand Ayatollah Khamenei answered a question about playing music in Mosque.
Question: What is the ruling about playing music for Halal and logical purposes in a holy place like Mosque?
The Grand Ayatollah Khamenei: Playing inappropriate music which is suitable for sinful gatherings is absolutely not allowed; even in places other than Mosque and for logical purposes. But there is no problem to perform revolutionary nasheeds/anthems and similar to that together with music/melody in holy places and in appropriate occasions; on the condition that it is not disrespectful to that place and it does not bother worshippers in places like Mosques.
Source: Ajwabatul Istefta’at, Question 1144.