The took a group of students, and asked which ones liked working to music versus didn't. They then subdivided each into two groups, one of whom had to do a programming exercise in a room with music playing, and once of whom worked in a silent room.
They found no statistically significant difference between the performance of people depending on presence of preference for music.
BUT there was a trick! The problem involved a series of complex manipulations that simplified down to "give me back what I started with". All of the people who noticed that were in the quiet room.
The preliminary conclusion is that music doesn't harm productivity, but does hinder creativity.
Cheers,
Ben