When I'm doing items such as math or programming - I listen to upbeat pop music that can get me moving. It's as if my fingers are dancing or writing away to the beat. When I used to take math exams, all I could remember in my head as I took the exam was the songs that were playing as I was practicing and I might even hum along. In fact, it might even be the case that I have one song just stuck in my head on repeat.
However, when I need all of my mental energy to think architecture, understand or formulate a plan of action, music is distracting.