- Peninei Halakha
Many poskim maintain that there is no difference between listening to live music and listening to music on the radio or any other electronic device; both are forbidden during the omer period (until Lag Ba-omer) and the Three Weeks. One may, however, listen to non-instrumental music on an electronic device (Igrot Moshe, yd 2:137, Yeĥaveh Da’at 6:34). Some forbid even this, because the device itself is considered a musical instrument (Tzitz Eliezer 15:33, Shevet Ha-Levi 8:127).
However, some maintain that the prohibition on music does not apply to listening to music on the radio or any other personal electronic device, as listening to music this way is not festive, whereas live music is. Furthermore, nowadays, listening to music on electronic devices is a regular, universal practice, and since it has become so routine, it is no longer considered a source of joy and festivity. Thus, listening to it is like listening to singing without musical accompaniment, which is permitted during the omer period. In addition, a distinction should be made between joyous songs and regular songs; only joyous songs should be forbidden to listen to during the omer, but regular tunes, and certainly sad tunes, should not be prohibited during the mourning period of the omer. Therefore, one who wishes to be lenient may rely on this opinion and listen to regular and sad songs on a personal electronic device. However, he should not play this music loudly, because the power of a sound that fills a room generates a festive atmosphere.
It seems that according to all views, a driver who is worried that he might fall asleep at the wheel may listen to music in order to keep himself alert.
 The following poskim prohibit listening to music on electronic devices: In Igrot Moshe, yd 2:137 and oĥ 1:166, R. Moshe Feinstein ruled stringently, stating that one may not listen to musical instruments throughout the year, as a sign of mourning for the Temple’s destruction – all the more so, during the omer period and the Three Weeks. And even though R. Ovadia Yosef permits listening to music throughout the year, he prohibits listening to instrumental music on the radio and the like during the omer period and the Three Weeks (Yeĥaveh Da’at 6:34). (In private conversation, however, he permitted Israeli radio station Arutz Sheva to play music, to ensure that they would be able to continue broadcasting Torah-oriented shows.) Minĥat Yitzĥak 1:111 concurs. R. Shlomo Zalman Auerbach and R. Yosef Shalom Elyashiv prohibit listening to music on the radio as well (Shalmei Mo’ed, p. 453). Tzitz Eliezer 15:33 and Shevet Ha-Levi 8:127 forbid even non-instrumental music.
However, the reasons for leniency are compelling. First of all, musical instruments are not necessarily expressions of joy. See Shabbat 151a, which mentions that flutes were used in funeral elegies. Similarly, Pri Megadim permits playing music during the omer period in order to make a living; this ruling is quoted in bhl 551:2. Maharam Schick (yd 368) discusses the distinction between joyous tunes and sad tunes, stating that sad tunes are permitted during times of mourning. (However, he prohibits teaching music to certain children during their year of mourning, because they learn music only to show off, not to make a living.) In any case, we see that only joyous songs are forbidden. In mt, Laws of Fasts 5:14, where Rambam deals with the prohibition of playing music following the destruction of the Temple, his language implies this as well: “Similarly, they ordained that one should not play melodies with any sort of musical instrument. It is forbidden to celebrate with such instruments or to listen to them being played beacause of the destruction [of the Temple].” Based on this, it seems that the prohibition against listening to musical instruments relates mainly to happy songs, which are often accompanied by dancing, but regular songs – and certainly sad ones – are permitted. Responsa Ĥelkat Yaakov 1:62 brings up another point: listening to music via electronic devices is not included in the decree (or custom) of mourning, because these devices did not exist when the decree (or custom) was originally established. It may be that the reason many poskim disagreed with this ruling is that these devices were rare at the time, and listening to them was considered a festive activity. Nowadays, however, listening to music players is routine and uneventful; therefore, it is not included in the custom to refrain from listening to live music. My father and teacher, R. Zalman Baruch Melamed, agrees with this viewpoint. R. Shmuel David writes likewise in Teĥumin, vol. 13. See also below 8:4. Once again, since the entire prohibition is based on a custom, the halakha follows the more lenient opinion in cases of uncertainty. This is how Arutz Sheva conducted itself during the mourning period of the omer, broadcasting regular songs and avoiding songs that evoke celebration and dancing.
All agree that one may not attend a concert, even if the songs being performed are regular or sad songs, because the very act of gathering for a concert is festive and thus joyous. In my humble opinion, the same is true of listening to mild songs at a high volume: they become somewhat festive because of the force of the sound. According to all opinions, a driver may listen to music in order to keep himself awake, both because listening to music while driving is not so joyous and because of the possible danger to life. Even the poskim who rule stringently agree that one who suffers from depression may listen to music in private, as cited in Hilkhot Ĥag Be-ĥag ch. 7 n. 39.