COMPOSING MUSIC WITH COMPLEX NETWORKS C. K. Michael Tse Hong Kong Polytechnic University Presented at IWCSN 2009, Bristol
Acknowledgement Students Mr Xiaofan Liu, PhD student Miss Can Yang, MSc student Collaborators Dr Michael Small Dr Francis Lau 2
Contents Complex networks from music Universal network properties Re-composition from networks Imposing some properties Motifs, rhythms, variations, etc. as missing information Combining complex networks and music properties Enhanced algorithm for computer composition link node 3
Music Tone (pitch) Rhythm (tempo) Texture (instrument, vocal, accompaniment, etc.) 4
A Simple View Sequence of notes 5
Music as a co-occurrence network Schubert s Lullaby Note 1 note 2 note 3... A network can be constructed by connecting notes as the music is played. 6
Node and Edge Node = note (pitch and time duration) Edge = co-occurrence connection C crotchet and C quaver are two different nodes 7
The idea Represent music by network 8
Illustration Music treated as sequence of notes. Each unique note is a node. As music is played, nodes are connected as they appear one after another. 9
Network from Bach 10
Examples Bach s violin sonatas 11
Examples Bach s violin sonatas 12
Examples Chinese pop from Jay Chou Chinese pop from Teresa Teng 13
Analysis Music composed by Bach, Chopin and Mozart, as well as Russian folk and local pop music Size of network Density of network Degree distribution Degree/Node correlation Clustering 14
Parameters Length of composition, T Number of nodes, N Total number of edges, Mean degree, Mean shortest distance between nodes, Clustering coefficient, C Power-law exponent of degree distribution, γ 15
Degree distribution 16
Power-law exponents 17
Other parameters 18
Conjecturing... All musics share similar scalefree degree distributions A feature that seems to be universal to appealing musics Can we reconstruct music with this property? 19
Composing music Construct a network 5 Choose a random node to begin Go to next node by 1 2 3 choosing one of the neighbouring nodes according to a probability function which is proportional to edge weight (algorithm 1) 1 2 3 4 2 5 4 node degree (algorithm 2) node strength (algorithm 3) These are basically controlled random walk algorithms 20
Samples from controlled random walk algorithms Originals Re-composed Bach s violin Bach s? Chinese pop Chinese? Recomposed Bach s music 21
Comparisons 22
Happy with those music? What makes music music? Preserving the network properties alone are not sufficient! What properties do music possess that are not described by the network parameters? Tempo, repetition, rhythm, motif, etc. 23
Repetition Considerable repetition throughout the same piece. Experiment: 1. Look for repeated blocks of notes. 2. Mark all repeated blocks from length 2 up to r. Repetition = no. of repeated notes in a row of 2 to r total no. of notes 24
Temporal property Re-composed samples (from Chinese pop): Temporal information is lost, and the music may sound un-orderly. 25
Bar lines In music with a regular meter, bars indicate a periodic agogic accent in the music. There are rarely cases that lots of music notes been played across bar lines. 26
Rhythm Rhythmic property is not described by the constructed network Regular / irregular rhythm Isochronous / convulsionary rhythm Mold / desultory rhythm Regular rhythm Strong beats at long tones and weak beats at short tones. Irregular rhythm Strong beats at short tones and weak beats at long tones. Isochronous rhythm Lengths of all tones are identical. 27
Motifs Music motifs: Frequently appeared short groups of notes that often define the theme/ signature of a piece of music Composer s inspiration Example: Mozart s sonata, note the 1st and 3rd lines Well known motifs: Beethoven s Symphony no 5 Mozart s Twinkle twinkle little star 28
Motifs not normally found in re-composed music (random) 29
Motif developments Sequence of motifs Variation of motif by adding/removing notes Repeating part of a motif etc. 30
Incorporating musical properties Can we recover these properties in our compositions? New algorithm that guarantees the necessary network properties and incorporate the needed musical properties. Can we incorporate motifs in our controlled random walk algorithm? 31
Rhythmic and tonal motifs music motif rhythmic motif tonal motif Compare with network motif: frequently occurred connection styles Not quite the same!! 32
Identifying music motifs Rhythmic network Tonal network From the networks we may identify short sequences of notes that repeat frequently throughout the piece. These sequences of notes are music motifs. Likewise, we can find sequences of note durations and/or pitches. And they are called rhythmic and tonal motifs accordingly. 33
Example Rhythmic motifs for satonoaki Tonal motifs for satonoaki 34
Music motif as backbone Network backbone: The degrees of notes of a network backbone are large compared with others. The edge weights of network backbone are with big values. 35
Combining complex networks, temporal rules, motifs, etc. 36 C. K. Tse, Hong Kong Polytechnic University
Approach 1. Choose a piece. Construct network. Identify rhythmic and tonal motifs. Identify rhythm. 2. Create music motifs by combing rhythmic and tonal motifs. 3. Biased random walk algorithm is still used to connect composite motifs. 4. Align notes with bar lines. 5. The rhythmic type follows the original. 6. Decorate with accompaniment. 37
Satonoaki Japanese folk song Motifs Complex network network motifs 38
Creating new motifs IDEA: Rhythmic motif + tonal motif = music motif Rhythmic motifs: R 1, R 2, R 3,... Tonal motifs: T 1, T 2, T 3,... New music motif can be formed by pairing R i with T j R i T j Each new motif has a probability of occurrence p ij which is jointly proportional to the frequencies of occurrence of its seed rhythmic and tonal motifs. 39
Main features of algorithm The basic algorithm is still the controlled random walk When a node which is the start of the backbone (music motif) is chosen, the entire motif will be played. If a node belonging to more than one backbones is reached, the probability value is used to select the motif. Then, the same controlled random walk resumes. Impose bar alignment and rhythm control: basically bias towards nodes that facilitate alignments. What you are listening now is without imposing rhythm control. 40
41
42
Conclusion & on-going work Complex networks are good modeling tools to identify essential properties. Algorithms can be developed to compose music that preserves essential network properties. But the available music is in large quantity, and filtering is essential to select good music. Raising the entropy?? Imposing rudimentary features help filtering substantially, i.e., temporal alignments, etc. Incorporating music features, i.e., motifs, greatly improve musicality. 43
References CK 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, Budapest, Hungary, pp. 5-8, September 2008. X Liu, CK Tse and M Small, Composing Music with Complex Networks, Workshop on Complexity Theory of Art and Music, International Conference on Complex Sciences: Theory and Applications, Shanghai, February 2009. X Liu, CK Tse and M Small, Complex Network Structure of Musical Compositions: Algorithmic Generation of Appealing Music, Physica A, to appear. C Yang, CK Tse and X Liu, Composing Music with Motifs, International Symposium on Nonlinear Theory and Its Applications, Sapporo, Japan, October 2009, to appear. 44
Other on-going works in this area Applying scalefree distributed graphs in coding (LDPC) Modeling telephone networks with scalefree user networks Disease transmission, community outbreak of SARS, avian flu transmission Finance data modeling, stock market networks Chinese language occurrence properties from occurrence networks Information: http://chaos.eie.polyu.edu.hk 45