I'm not a fan of listening to music when I write. Part of the problem is the words. I find a part of my brain starts following those words. Especially if it's a song I like. More dangerously if it's a song I don't like but that has hooks in it that pull my brains out through my ears. "Tom's Diner" is one such song. The intro to that can get stuck in my head for days. When my brain goes haring off after those words I'm screwed. My words can't keep up.
Some songs are distracting because I dislike the artist so much I'll start some sort of weird mental spiral about how much I dislike them, and how stupid is the radio station that they'll still play them, or how'd they end up on this Pandora station?
So, when I write I'll either listen to classical music or if the muse has really set me on fire I'll listen to some electronic techno stuff around 180bpm and type until my fingers cramp. As much as I like ambient stuff it's no good for writing. I find myself slowing down too much. I'm, in the words of Grace Jones, "A slave to the rhythm." Although to be more truthful it's be "slave to the beat."
Dead silence isn't good for me for writing. I don't know why, but if it's too quiet I hear other things, odd things. Maybe a fan or some white or brown noise would be useful as well. If music weren't practical. I don't know. I've never tried it for writing. I've used brown noise to sleep to though... probably having the sleep association attached to it would make it a bad choice for writing.