We’ve all been there: Employees decide to take a break and converse, just when you’re at the crux of an issue. Or, the office next to yours realizes they have bare walls, and spend the entire hammering and hanging up pictures. Whatever the reason, you need to isolate yourself from the noise, and decide to turn on your music and tune out the world to focus better on the tasks at hand.

Since listening to music while working first became a convenient possibility, there has been a debate over whether or not doing so boosts productivity. Multiple studies have been done on the matter, and the answer is: It depends on the person and the situation.

Breaking the Monotony
When we are filling out expense reports, packaging products, setting the schedule for the next few weeks or performing other monotonous tasks, it is easy for the mind to wander. And when our minds wander, they eventually land on something unpleasant, like that one guy who took too long in the Starbucks like, or how earnings were lower last quarter than expected. Listening to music can be sort of an energy injection for your mind that brings us back to the present. Melodious sounds encourage the brain to release dopamine, which is linked to the reward center of your brain.

In a study, it was found that workers in certain fields, like information technology, completed their tasks faster and came up with more innovative ideas when they listened to music. However, this result is not uniform across all workers. Those who have been in their field for long enough to be considered experts saw very little change in productivity. Moderately-experienced employees benefited to most. Finally, the productivity of some novices actually suffered when they listened to music, because they needed to focus more on the task at hand. In addition, younger workers were more prone to listening to music than older workers.

A Distraction for Creative Types
In a similar study, cognitive neuroscientist Daniel Levitin found that listening to music can actually make workers less productive in certain jobs. Tasks that require intellectual focus, such as reading or writing, suffer when music is being played. This is because, for these tasks, your brain requires much more attention capacity, and any distractions like music detract from that. And when we do feel like we are more productive with music on, it’s just that — a feeling. Music does boost our moods through releases of dopamine, which makes you feel like you’re having more fun and getting more done, even when you aren’t.