I remember reading a tashubho from the Rambam where he clearly states that music can treat depression and therefore it is ok to listen to if you are depressed. However, I can't seem to find it at the moment. Can someone help me out?
In the introduction to his commentary on Masekhet Avot (Shemonah Peraqim), chapter five, the Rambam says (in Shmuel ibn Tibbon's translation):
In an English translation (from Wikisource):
Regarding understanding the Rambam as saying that it's O.K. to listen to music in such a case (and in other cases as well), see "דעת הרמב"ם והגאונים לענין שמיעת כלי זמר ושירה בזמן הזה" (PDF).