When computationally analyzing a piece of music one of the most important pieces of information you might want is the start and end times of the notes. To determine this you can plot and visually inspect the frequency spectrum which is tedious but accurate, or you can use some of the available audio analysis libraries. This video will show some simple examples using the Python library pyAudioAnalysis where it performs well, not so well, and quite poorly, to illustrate its strengths and weaknesses. I will also demonstrate where it performs much better than some of the other available libraries.
For the trumpet fanfare recording, thanks to http://www.freesfx.co.uk