Jordan has done a very nice job mapping the ideas of music theory to patterns that a programmer would understand.
https://medium.com/@alwaysbcoding/an-intro-to-music-theory-for-hackers-8969ad4c1231
If you've never explored music from a theory or analytic stand point I think Jordan's article is a very good place to start.