I feel Sonic Pi is an excellent environment to start learning musical programming.
http://sonic-pi.net/
The code is in Ruby and everything you need to get started is at the link above.
I also highly recommend the Grid Studies for learning how to work with the monome grid.
http://monome.org/docs/grid-studies/
I’d focus on Max, Processing, and Pure Data as a beginner.
If Sonic Pi really sticks with you, and you start thinking you might want to learn Ruby in a more in-depth way, _why’s Poignant Guide to Ruby is the most entertaining way (if not the most straightforward way) to take a deeper dive.
http://poignant.guide/
The poignant guide also has a soundtrack made by _why himself.
Heading back in a more musical direction, the Supercollider tutorials are great.
http://supercollider.github.io/tutorials/
So, I just recommended you try 5 different programming languages. That might seem overwhelming. Does a beginner really need to know 5 different programming languages? No, not at all. You can probably choose one programming language and that choice is likely going to be valid for 95% of what you’re going to want to do for the rest of your musical life. The reason you want to try lots of languages as a beginner is so that you can see which one fits your peculiar brain the best. It’s also helpful when starting out to look at how multiple languages do various things so that you can start to see what they have in common and what they do differently, which things are going to be the way they are no matter what language you choose, and which things are essentially arbitrary/taste/style and vary greatly from language to language. Only you can do the hard work of figuring out your preferences in these latter areas. And it matters a great deal to your ongoing productivity and success as a programmer.
How long does it take to learn programming? You’ll be making sounds with Sonic Pi within minutes. You’ll be learning and growing and achieving greater mastery over the crafts of programming and music for the rest of your life. I started programming at the age of 9. I’m 41. I still feel like a complete beginner.