I can’t imagine listening to songs with lyrics (at least in a language I understand) while I’m writing, but I imagine that sometimes a certain tune or whatever will set the scene or tone for what you’re writing.
I’ve been listening largely to classical in the new writer’s room L gave me for Christmas, had forgotten to consider jazz, but it mostly has to be without words. Maybe I’ll give the jazz a shot tonight. For programming I’ll listen to anything, but writing it really needs to be just wordless. That said, I’ve definitely been inspired by some songs to write short stories or more after hearing some music or while just henpecking the keyboard while listening to music (“Destiny Calling” (pdf link), title ripped from the James song of the same name, “A Parable” inspired by “Pale Green Stars” by Everclear (go figure), and, of course, the Spice Girls song at the beginning of the first draft of God Coffee, I Miss You, perpetually in an unfinished state now). With the first two, at least, it was the melody, more than the words, that drove me… captured that certain feeling… I still think of “Destiny Calling” as a Brooklyn story – three storeys up after having finished Timequake (Kurt Vonnegut) in the old apartment on Atlantic Avenue, and “A Parable” as a London/Chelsea story, again, three storeys up in a mansions block, looking out at the Royal Albert bridge at night a few days after September 11th, 2001.
So there you have it.