Getting into tracker software might another approach. You could consider the tracker score notation the programming language, and the tracker player the complier/interpreter.
There are plenty of music modules (songs) you can load and play with. These are shared all the time.
You can use tracker software out of the box to edit your 'input music' (E.g. OpenMPT).
There are lots of open-source libraries that allow you to play music in this format e.g: http://xmp.sourceforge.net. So getting your hands on the source code to a player may get you to ahead in manipulating aspects of a song via your programs.
This is how many computer games played music (especially older, arcade games where memory was limited and could not afford whole sample data of final songs to exist).
Many tracker module players already allow crude song control; mute instrument, swap instruments, mute track, change tempo, jump to song position. Games can already execute crude song control in real time in synchronisation with in-game events (jump to same pattern position in a different set of patterns or unmute channels whilst the game character is using an invincibility power-up, or for the end-of-level fight against the big boss man).
Many tracker editors are also open source (MilkyTracker, OpenMPT) and will have functions for transposing parts of the song (since they're keyboard shortcuts within the application) as well as playing the songs (since the song editors also play the songs).
Hopefully, this might give you some ideas. Despite not being a traditional programming language.