If you want to learn to write and play music, don't delve into the math except as a side project. Learn to play a few simple songs that you like, using 3-4 simple chords (there are a ton of tutorials for that), and then spend 1,000 hours playing around on the vicinity of that musical environment. There is no shortcut, it is not about learning patterns, music is a different language, and learning music is about awakening your musical self.
Learning to accompany yourself while you sing a few songs needs no understanding of the mathematical foundations at all (and they don't really help), it's mostly about learning a few basic patterns (3-4 chord finger positions) and then being good at performing (mostly tied to self-confidence). Learning to play common songs doesn't take much more. Learning to improvise and to write your own songs requires 1,000+ hours of the type of "playing/dancing/exploring" I was mentioning above. You'll learn the theory on the 10% of those 1,000 hours that you are resting and browsing the internet.