Complex Network Application in Music: Uncovering Universal Properties in Favourable Human Perception of Music

C. K. Tse and M. Small
Hong Kong Polytechnic University
Email: encktse@polyu.edu.hk

For details of network constuction, music recomposition and archives of sound files, please see http://cktse.eie.polyu.edu.hk/MUSIC/.

 

Introduction

Across cultures, and between individuals, certain musical pieces are consistently rated more favourably than others and the mathematical analysis of musical perception has a long history [1]. In contrast to previous descriptive mathematical analyses, we introduce a data-driven transformation to represent a musical score as a complex network [2, 3]. We find that musical scores which are widely perceived to be "good" generate complex networks with certain invariant properties: scale-free networks with strong clustering of nodes within the network. We describe a method to generate random musical compositions from these networks (essentially, as a weighted random walk on the network) and find that scores generated in this manner are also perceived to be "good" and are qualitatively similar to the specific score from which the generating network was produced.

FIGURE ON THE LEFT: Section of Mozart's sonata.

 

 

Network Construction

A musical score, or even the performance of a particular musician can be represented as a MIDI (Musical Instrument Digital Interface) file. The MIDI file encodes a musical composition as a series of events, where each event includes information describing both the pitch and timing of a note. (If a MIDI file is transcribed from a musicalscore, this information will be precise; if the information is derived from an actual performance there will be more variability.) Using this information we construct a complex network as follows. Each MIDI event (a single musical note) corresponds to a node in the complex network. wo nodes in the network are linked by an edge if they succeed one another in the musical score. Weight is ascribed to a given edge based on the relative frequency with which the two nodes are adjacent. Directionality is based on temporal order.

FIGURE BELOW: Network gerenated from the entire Mozart's sonata.

We apply this transformation to a wide variety of musical composition including the sonatas of Bach and Mozart, Bach's "Well-Tempered Clavier", Chopin's waltzes, Russian folk music and Cantonese pop. In all cases the networks generated by this algorithm exhibit a scale-free distribution (using the maximu liklihood procedure described in [4] at the 95% confidence interval) on the node degree (that is, the probability of a node having degree k, p(k) = k-gamma [2]) with degree exponent gamma falling in a narrow range 1 < gamma < 1.7. As a natural consequence of variability in a human performance we observe that for MIDI files derived from actual rendition, the clustering within the network is much lower (clustering coefficient 0.127 +/- 0.069) in comparison to MIDI derived from musical score (0.37 +/- 0.056). Nonetheless, in all cases the scale exponent falls within a fairly narrow range. Notably, the scale exponents for Russian folk music (1.18) and Cantonese pop (1.01) are significantly lower than those derived from classical music (1.29 ~ 1.67). For our data, scale invariance in the node degree distribution is a necessary condition for music to be perceived positively.

FIGURE ON THE LEFT: Degree distribution for the same Mozart's sonata network (number of links k versus frequency p(k).

 

Discussions

These complex networks therefore encapsulate some features of the underlying musical scores used to generate them. We can also use these complex networks to generate new artificial scores which share the same properties. We choose a random initial node on the network and randomly follow one of the links from that node to another based on the relative weight of the links. We repeat this procedure and record the sequence of nodes that are traversed. The corresponding notes (both pitch and duration) give a random score. If one was to then generate a new network from that score it would (asymptotically) be equivalent to the original. The suprising and intruiging consequence of this procedure is that the random scores are both pleasing and qualitatively similar to the original score. That is, random scores generated from the network derived from Chopin's sonatas also sound like Chopin, those derived from the Cantonese pop network also sound like Cantopop [5]. Of course, by virtue of our simple construction these random scores will lack the large scale structure of the original and be somewhat more variable. But, this does demonstrate that the complex network encapsulates enough information to quantify basic features of a particular composition or style. As with actual composition, large scale structure can be imposed aposteriori and selection from between many candidate random scores can be used to produce "optimal" compositions.

References

  1. C. Callender, I. Quinn and D. Tymoczko Science, 320, 346 (2008).
  2. A.L. Barabasi and R. Albert, Science, 286, 509 (1989).
  3. S.H. Strogatz, Nature, 410, 268 (2001).
  4. M. L. Goldstein, S. A. Morris, and G. G. Yen, Eur. Phys. J. B 41, 255 (2004).
  5. Materials, methods and additional quantitative analysis are available on Science Online. Samples of MIDI files generated with these procedures are also provided online from the first author's homepage (http://cktse.eie.polyu.edu.hk/MUSIC/).

Publications

  • Preliminary results:
    C.K. Tse, X. Liu and M. Small, "Analyzing and Composing Music with Complex Networks: Finding Structures in Bach's, Chopin's and Mozart's," International Symposium on Nonlinear Theory and Its Applications, (NOLTA2008), Budapest, Hungary, pp. 5-8, September 2008. [Download Paper]
  • Refined results and compositions:
    X. Liu, C.K. Tse and M. Small, "Composing Music from Complex Networks," submitted to COART, COMPLEX 2009.

First written 2 May 2008; updated 23 September 2008