I'm definitely a lot more productive when I'm in the appropriate mood to write. And nothing puts me in the right mood like music!
A friend online introduced me to a band called Nightwish. Think of operatic metal with great lyrics and epic instrumentation, with fantastic singing. Great stuff for writing horror/fantasy/weird fiction to!
Combined with headphones, I can effectively create my own environment tailored to what I'm writing. It's wonderful, it removes all distractons in an instant withut requiring me to unplug the phone and nail my doors and windows shut.
Environment makes a big difference to me. I've tried writing in coffee shops and out in the park, but I'm distracted by the people and/or the beauty of Nature, and end up not writing. I'm one of those "need my writers nest" writers.
Now, what music would be best for writing comedy? Much to consider!