Programming is quite a remarkable activity:
- It has an extremely low barrier to entry
- You don't need expensive equipment
- You don't need to be in a particular location
- You don't need special credentials
- You can finding information / resources just by opening the internet
- You can learn it / do it independently
- It gives you rapid feedback (which can lead to rapid growth)
- It gives you frequent rewards (which gives a huge boost in motivation)
- It's objective and unforgiving (this is a good thing, because it teaches you how to confront reality)
- It's intellectually stimulating
- It's useful in the real world
- Corollary: you can make money or even build a career out of it
- It's badass (or are you telling me that Hackers WASN'T your favorite movie of all time?)
- Electronics (but this is basically still programming)
- Math (lacks "rapid feedback" and "frequent rewards"; "useful in the real world" is also questionable)
- Go, poker, video games (usually lacks "useful in the real world", sometimes lacks "badass")
- Juggling, poi (lacks "intellectually stimulating" and "useful in the real world")
Whether it's simply a rhythm, or playing a melody, or adding a harmony, every part about playing music engages the math part of the brain.
That doesn't mean you need to understand calculus to play. It's simply addition and basic translations, but it's a constant barrage of adding things and subtracting things.
If it's a piano or guitar, or even a voice, you have to know that do re me fa, is whole step - whole step - half step. The fretboard or keyboard is a large numerical puzzle. It's right in front of you, and what makes a good singers is someone who mentally works in that musical puzzle. Adding steps and half steps. You never really add past 12, because you can start over then. You don't need an advanced mathematics degree to solve the puzzle, but your brain is doing (simple) math constantly.
Not only that, but music is, since the beginning of time, the essential example of how to train your brain, to do without doing. The brain patterns of jazz musicians in performance resemble those of meditating monks.
The idea that the connection is tenuous may suggest you don't play music. If you've never made a beat before, try this:
openmusicgallery.appspot.com/drums.htm
Now keep in mind, this is just telling the program when to play a beat. If a human were to try to play these beats, they'd be doing math the entire time (not differential equations, but still math). Making sure beats are evenly placed is just counting. Once you've done it enough, you don't literally need to count "1,2,3,4" but I know many professional drummers that do exactly this, and are nearly flawless because of it.
I'm a professional musician, I also do creative coding for artists. One interesting tension is that some artists don't think that music is art. I agree with them 99% of the time. You can get paid a few hundred bucks to play Lynryd Skynrd song, which ends up being paint by numbers.
Music on the whole is just paint by numbers. Occasionally it breaks into the realm of genuine art. In any case, like programming, I find that it is merely a vehicle for expressing things.