  Topological data analysis has been recently applied to investigate stylistic
signatures and trends in musical compositions. A useful tool in this area is
Persistent Homology. In this paper, we develop a novel method to represent a
weighted directed graph as a finite metric space and then use persistent
homology to extract useful features. We apply this method to weighted directed
graphs obtained from pitch transitions information of a given musical fragment
and use these techniques to the study of stylistic trends. In particular, we
are interested in using these tools to make quantitative stylistic comparisons.
As a first illustration, we analyze a selection of string quartets by Haydn,
Mozart and Beethoven and discuss possible implications of our results in terms
of different approaches by these composers to stylistic exploration and
variety. We observe that Haydn is stylistically the most conservative, followed
by Mozart, while Beethoven is the most innovative, expanding and modifying the
string quartet as a musical form. Finally we also compare the variability of
different genres, namely minuets, allegros, prestos and adagios, by a given
composer and conclude that the minuet is the most stable form of the string
quartet movements.
