I use the playlist function on iTunes to create background music for writing. I put songs into playlists according to what sort of energy they invoke, how "high-profile" they are (some songs just attract more of my attention when they play) and how appropriate they are to a given story.
I have quiet, contemplative playlists for quiet scenes. Tense, anguished playlists for drama. Story-specific lists full of songs the characters have pointed out to me. I mix and match these playlists too. Most of Disciple, Part III was written, for example, with my ambient/melancholy/smooth-electronica/Disciple-specific blend playing in the background. (combined length of those lists is about 2 days and 3 hours.)
Except for the combat portions of the story (of which there are many) which require something very different. Crafting a playlist specifically for writing combat has proven tricky, for me. I've been working on it since I was writing Orbital Shifts (which had a fair amount of ship-to-ship science fiction combat) over the summer last year.
Here's what I've got so far -- I call this playlist "Heavy" to distinguish it from the "Fast Electronica" and the "Grungy/Dark" playlists. The full list is currently 70 tracks but not all of them are available on Playlist.com (I collect a lot of small bands' and DJs' music, because a lot of it is free.) I found about half of them and made a public list for you all.
Needless to say, Caution: loud, angry stuff here. I generally cut this playlist with "Fast Electronica," "Melancholy," and the story-specific playlist to keep my blood pressure under control.