LilyPond rules when you want to manipulate music algorithmically. Like make a music reading training app that creates examples based on your performance so far.
music21: http://web.mit.edu/music21/
mingus: http://bspaans.github.io/python-mingus/index.html
abjad: https://abjad.github.io/
music-suite: https://music-suite.github.io/docs/ref/