I recently read an article that asked a similar question of several authors and the response was both individual and similar. It seems that they either cannot have any music at all or have to have music while writing. Those that listened to music clearly chose their music to complement the story they were writing - to fit the mood.
According to them (I don't recall which authors were in the article but these were specifically fantasy authors), the mood the music creates had a definite effect upon the writing - choose the wrong music and the writing will not go well. So they were very specific in what they listened to while writing certain books and specific scenes. In addition, they changed often. If they listened to La Triviata while writing one book, they couldn't listen to it while writing another or portions of the other story would creep in.
I personally know that associations can play a major role in how you get work done, how you feel, and how you react to certain situations. I associate a certain scent with my high school trip to Europe. I cannot wear it without thinking of those times, thus I don't wear it and only smell it occaisionally while out at the store, otherwise I would lose that association. Additionally, music plays an important role in our mood and activity. I get a whole lot more work done (especially cleaning) if I can listen to old favorites to which I know the words and can sing along. At work, it is nice to be able to listen to very quiet music that is very familiar so that it can play along in my head but not disturb the work - new music would entice me to listen harder and distract me from what I need to get done. Music that doesn't break my concentration, specifically classical, is great for stressful situations or times when thought and concentration is important, like driving in a lot of traffic. Have you ever noticed that if you get lost while driving or run into a lot of traffic that many people unconciously turn down the music? I've noticed just about everyone I've driven with do this and find it interesting.
Blah blah blah. When did I become an expert on music? I sound so pompous! In any case, the above dull lecture was composed of my personal experiences only.