but if you have to choose, sample a little john legend
The beat of the music tends to disturb my "beat" of thinking. It's a bit weird but I can only describe it the following way: my mind thinks in a certain rhythm and when I'm listening to music, I feel like I have to adjust my mind rhythm to the rhythm of the music and it drives me crazy.
Sometimes though (depending on the mood) listening to music helps me focus (that's rare though). In those cases, listening to the music stops my mind from jumping all over the place and forces me to just focus on the task at hand.
It's probably related to whether I'm trying to think of possibilities vs just implementing an idea I've already fleshed out in my head.
YMMV