stefano ferretti arxiv:1709.09708v1 [cs.sd] 13 sep 2017

32
On the Complex Network Structure of Musical Pieces: Analysis of Some Use Cases from Different Music Genres Stefano Ferretti Department of Computer Science and Engineering, University of Bologna Mura Anteo Zamboni 7 Bologna, Italy [email protected] Abstract This paper focuses on the modeling of musical melodies as networks. Notes of a melody can be treated as nodes of a network. Connections are created whenever notes are played in sequence. We analyze some main tracks coming from different music genres, with melodies played using dif- ferent musical instruments. We find out that the considered networks are, in general, scale free networks and exhibit the small world property. We measure the main metrics and assess whether these networks can be con- sidered as formed by sub-communities. Outcomes confirm that peculiar features of the tracks can be extracted from this analysis methodology. This approach can have an impact in several multimedia applications such as music didactics, multimedia entertainment, and digital music genera- tion. 1 Introduction The recent advances in information retrieval techniques, big data analysis and complex network methodological tools foster novel approaches to the musical domains, ranging from music classification, categorization to automatic gene- ration [4, 17, 34, 36, 38, 40, 41, 42]. It has been recognized that network science can be employed to represent music as a network [18, 28]. This is a consequence of the motto “everything as a network”, based on which, several types of real and digital systems are represented and studied as complex networks. Examples range from food webs, human language to communication and mobile networks [10, 11, 12, 15, 16, 20, 32, 35]. In the musical domain, networks can be constructed to model melodies (and related harmonies), with nodes corresponding to musical notes and edges corre- sponding to their co-occurring connections [18, 28]. This alternative view of a musical piece can give a graphical representation that provides a first sketch of how complex or simple is the melody itself. But there is much more: sophisti- cated analyses can be made to measure mathematical metrics which characterize the network. This allows obtaining important insights on the net and the cor- 1 arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Upload: others

Post on 31-Jan-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

On the Complex Network Structure of Musical

Pieces: Analysis of Some Use Cases from

Different Music Genres

Stefano FerrettiDepartment of Computer Science and Engineering, University of Bologna

Mura Anteo Zamboni 7Bologna, Italy

[email protected]

Abstract

This paper focuses on the modeling of musical melodies as networks.Notes of a melody can be treated as nodes of a network. Connections arecreated whenever notes are played in sequence. We analyze some maintracks coming from different music genres, with melodies played using dif-ferent musical instruments. We find out that the considered networks are,in general, scale free networks and exhibit the small world property. Wemeasure the main metrics and assess whether these networks can be con-sidered as formed by sub-communities. Outcomes confirm that peculiarfeatures of the tracks can be extracted from this analysis methodology.This approach can have an impact in several multimedia applications suchas music didactics, multimedia entertainment, and digital music genera-tion.

1 Introduction

The recent advances in information retrieval techniques, big data analysis andcomplex network methodological tools foster novel approaches to the musicaldomains, ranging from music classification, categorization to automatic gene-ration [4, 17, 34, 36, 38, 40, 41, 42]. It has been recognized that network sciencecan be employed to represent music as a network [18, 28]. This is a consequenceof the motto “everything as a network”, based on which, several types of realand digital systems are represented and studied as complex networks. Examplesrange from food webs, human language to communication and mobile networks[10, 11, 12, 15, 16, 20, 32, 35].

In the musical domain, networks can be constructed to model melodies (andrelated harmonies), with nodes corresponding to musical notes and edges corre-sponding to their co-occurring connections [18, 28]. This alternative view of amusical piece can give a graphical representation that provides a first sketch ofhow complex or simple is the melody itself. But there is much more: sophisti-cated analyses can be made to measure mathematical metrics which characterizethe network. This allows obtaining important insights on the net and the cor-

1

arX

iv:1

709.

0970

8v1

[cs

.SD

] 1

3 Se

p 20

17

Page 2: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

responding musical pieces. Moreover, based on these metrics it is possible tocompare different pieces, artists and music genres.

The approach differs from works related to audio analysis, where audio con-tents are manipulated so as to obtain measures related to similarity, statisticalproportions of music attributes or other metrics enabling classification [7, 30].In fact, the network is created starting from a symbolic representation of theaudio data, i.e., using a music score sheet. This clearly eases the analysis. Ithas been recognized that most musicological concepts such as melodic and har-monic structure are easier to investigate in the symbolic domain, and usuallymore successful [24]. The reader can refer to [19] for a comprehensive review onaudio and music based classification schemes presented in the literature.

Given a musical score sheet, we will focus on melodic lines, e.g. the mainmelody of a classical music composition or a solo performed by a musician ina jazz tune. The rationale is to exclude the repetitive parts of the track andconcentrate to the main and variable parts of a music song. In jazz and rockmusic, a solo is considered as one of the prominent parts of a musical piece, sinceit allows identifying the technical artistic skills of a performer. Indeed, it is acommon claim that each jazz and rock musician has its own typical “musicallanguage”, composed of preferred “licks” (i.e., recurrent patterns and sequencesof notes), scales, rhythmic patterns.

The representation of a melodic line as a network allows identifying themain characteristics of the music style of an artist, since the obtained networkharnesses the musical units (i.e., notes, chords, rests) and their relations. Infact, emergent properties due to the interactions between such music elementscan be decoded and analyzed.

As a proof of concept, we analyze musical solos and main melodies of famouscompositions and improvisations of different composers and performers, play-ing different instruments. We measure the main properties of the correspondentnetworks and discuss on the main metric values measured through the net analy-sis, and their meaning from a music analysis perspective. The considered trackshave been widely analyzed in musical terms; thus, the comparison between thegeneral musical aspects and the measures from their network representationfacilitates a musical interpretation of the obtained outcomes.

Results provide interesting insights. The structure of the network givesan idea of the complexity of the correspondent musical melody. It turns outthat we are dealing with scale-free networks, meaning that they show a degreedistribution that can be approximated with a power law function [16]. Scale freenetworks possess a high majority of nodes having small degrees; however a nonnegligible portion of nodes have higher degrees [32]. It is possible to identifyhubs (i.e., nodes with high degrees) that have a high number of connectionsin the network. This means that musicians do have some preferred notes thatare exploited during the composition of a melody track. This approach easilypermits also detecting which are those nodes that have a main influence on theconnectivity of the network (i.e., nodes with a high betweenness value). Theseare notes one should pass through to go from one part of the network to another.

Other metrics, such as the diameter, average path length, net density, clus-tering coefficient, concur in the identification of the complexity of the melody.These values can be also employed to identify if the network is a small world, i.e.,a net in which most nodes are not neighbors of one another, but the neighborsof any given node are likely to be neighbors of each other and a small number

2

Page 3: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

C

C

D D

D

C D

G-1/8

G-1/8

G-1/4

G-1/4

rest

rest

2

1

1

1

1

1

G2-1/4

G2-1/4

1

Figure 1: Example of melodic line mapped to a network

of hops is required to go from one node to another. Moreover, the modularityof a network can be measured, that describes if the network is clearly formedby some main sub-networks (communities) which are densely connected withrespect to the network. Such a feature would witness a preference of a musi-cian in playing certain groups of notes together in a given part of the melody.Finally, it is possible to identify those notes’ pairs that are frequently playedin sequence. This promotes the identification of important patterns that arewidely employed by a given musician in its “musical language”.

The presented approach can be exploited to discriminate among the mainfeatures of a musician, a music track or even a music genre. Thus, it canbe employed as a tool inside a plethora of multimedia applications concernedwith music classification, categorization, automatic generation of digital music,didactic scenarios and multimedia entertainment [6, 21, 23, 25].

The remainder of this paper is structured as follows. Section 2 presentsan approach to model musical pieces as networks. Section 3 discusses on themain metrics of interest that characterize the networks build from the musicaltracks. Section 4 provides and analysis on some practical examples comingfrom melodies of well-known musical tracks. Section 5 shows some aggregateresults of metrics of interest, obtained from a large set of melodic lines relatedto musical solos of contemporary musicians. Section 6 concludes the paper withsome final remarks.

2 Modeling Musical Pieces as Networks

2.1 From a music sheet to a network

Starting from a music sheet, a corresponding network can be built as follows.Nodes of the network correspond to specific notes. The note can be a single one,a rest or a chord, i.e., a group of notes played simultaneously. Each node has alabel associated to it. Labels vary depending on the type of note. In case of asingle note, the related node has a label composed of the note pitch, octave andduration. A “rest node” is labeled with the duration of the rest. Finally, nodescorresponding to chords are labeled with the pitch, octave and duration of eachnote composing the chord. Links are associated to nodes that correspond tonotes played in sequence in the sheet.

Let consider the example shown in Figure 1, where a simple music scoresheet of a melodic line is depicted together with the correspondent network.

3

Page 4: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

The text label reported over each note is the name of the note. Different notesare mapped into different nodes, that are labeled with the note name, as men-tioned (notice that we adopt here a simplified notation, and omit duration andoctave). Weights are assigned to links, counting the amount of occurrences ofthe corresponding notes pair. Thus, a link is created from the C node to D,(C,D), since the first note on the sheet is a C, followed by a D. Then, a self loop(D,D) is added to the network, since the third note on the sheet is a D, again.The fourth note is a C, that corresponds to the (D,C) link. A second occurrenceof the (C,D) pair increases the weight associated to that link. Then, there is asequence of links (D,G−1/8), (G−1/8, rest), (rest, G−1/4), (G−1/4, G2−1/4).Note that there are three different nodes for the G notes, since G−1/8, G−1/4have the same pitch (i.e., G) but different duration (the first G is a eighth note,while the second one is a quarter); moreover, G2− 1/4 is an octave higher thanother two G notes.

As a final remark, we notice that nodes and links might be enriched withfurther information related to specific musical aspects, e.g., a “legato” sequenceor better, the percentage of links that derive from legato notes. However, inthis study we do not consider these additional features.

The additional information added to nodes, or links, allows also to recon-struct the original score from the network representation. Indeed, it suffices toadd a list of sequence numbers to nodes (or equivalently, links), representingthe occurrences of the notes (or transitions from a note to the next one).

2.2 Melodies and harmonic structures

In the previous example, we focused on a melodic line, without considering theunderlying harmonic structure of the musical piece. As a matter of fact, themelodic line is guided by the chord progression, since the harmonic structureimplicitly influences the created melody.

It is possible to utilize the defined approach to model the harmonic structureas well. In this regard, we should note that the typical structure of a modernmusical composition is based on repetitive chord progressions (with variationsand modulations). Hence, the network associated with the harmonic progressionwould result in a simple network.

In this work, we will focus on melodies. However, the association of melodicmotifs and the corresponding chords of the harmony is another interesting as-pect, to be considered in further works.

2.3 Framework and software

Figure 2 shows how the data is manipulated by the workflow process. We startfrom a digital representation of a music data sheet. An in-house Java andPython based conversion software has been produced that takes as input MIDIor guitar tablature file formats (e.g., .mid, .tab, .gp3, .gp4 files). These files areconverted into MusicXML documents [2]. Such a representation of the musicalscore is employed as a further input for another own made manipulation soft-ware that creates a network representation of the considered melody. This isa Java software, that in turn uses the JUNG (Java Universal Network/Graph)Framework to analyze networks and extract the metrics of interest [33]. The

4

Page 5: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Music sheet representation

Network representation

Metrics

Musical features

Conversion

Analysis

Interpretation

From midi, tab, gp formats to MusicXMLFrom MusicXML to .net format

An own made software has been produced, together with the use of Gephi software

Figure 2: Data workflow

Apache Commons Mathematics Library was exploited to perform the mathe-matics and statistics analysis [1]. Finally, Gephi was used for the graphicalrepresentations and to measure the modularity of networks [5].

Algorithm 1 sketches the network creation scheme utilized in the conversionprocess depicted in Figure 2. The music score is parsed to extract the relatedset of notes, as already described. For each note, a novel node is added if notalready done (line 6). Then, we consider the node pair formed by the currentnote and the previous one; if a related edge between the two nodes alreadyexists, its weight is increased (line 10); otherwise, a novel edge is added to thenet (line 12).

It is worth mentioning that in this study, the step from the obtained metricsto a musical interpretation, depicted in Figure 2, is the result of a musicalanalysis provided by the author of this paper. The rationale was to demonstratethat certain well known musical aspects can be extrapolated from the networkstructure. Nevertheless, the approach can be combined with some artificialintelligence and data mining schemes in order to obtain some more valuableand general outcomes.

2.4 Music pieces considered in this work

In this work, we will focus on melodies coming from different musical tracks.We will consider these tracks separately, showing their network representation,degree distribution and main metrics of interest. This enables a focused analysis,that allows showing several characteristics of these tracks.

5

Page 6: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Algorithm 1 Network creation process

1: notes← parse music score and extract sequence of notes2: prev ← null3: nodeSet← [], edgeSet← []4: for each note in notes do5: if note not in nodeSet then . node associated to the note not yet in the net6: nodeSet.addNode(note)7: end if8: if prev 6= null then9: if (prev, note) in edgeSet then . edge already in the net

10: increase weight of (prev, note)11: else12: edgeSet.add((prev, note)) . add edge to the net13: end if14: end if15: prev ← note16: end for

The choice was to avoid repetitive melodies, that would generate simplernetworks. Hence, we selected solos of important musicians in jazz/blues/rocksongs, or main melodies of classical pieces. In fact, in jazz and rock music, a soloallows identifying the technical artistic skills, and the “style” of a performer.More specifically, we considered the following tracks:

• The solo played by Jimi Hendrix in his song titled “Red House”. Theemployed instrument to play the melody was the guitar.

• The solo played by Miles Davis in the famous jazz piece “So What”. Theemployed instrument to play the melody was a trumpet.

• The solo by John Coltrane in “Giant Steps”; in this case, the instrumentwas a saxophone.

• The melodic line of the piece “Caprice no. 24” composed by Niccolo Pa-ganini; the reference instrument is the violin.

• The melodic line of the “Flight of the Bumblebee”. This track has a well-known melody, famous for its difficulty in terms of speed of execution.There are several versions of performers playing this tune using differentinstruments, e.g., piano, flute, guitar, violin, etc.

Then, when looking at the small world property, we also take into account

• The second solo played by Eric Clapton (Cream) in the song “Crossroads”(guitar).

• The solo played by B.B. King in “Worried Life Blues” (guitar).

• The first solo played by David Gilmour (Pink Floyd) in “Comfortablynumb” (guitar).

6

Page 7: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

3 Metrics of Interest

Complex network theory is a mathematical tool that connects the real worldwith theoretical research. We already mentioned that this theory is employedacross a multitude of disciplines ranging from natural and physical sciences tosocial sciences and humanities [10, 32]. Thus, technological, biological, economicsystems, disease pathologies, protein-protein interactions, can be modeled in thesame way. Focusing on multimedia contents, it has been proved that differentmedia, such as language and music, can be seen as a system that can be repre-sented as a complex network [8, 11, 12, 17, 18, 20, 28, 35].

In this section, we introduce main metrics of interest that describe a musicaltrack. For the interested reader, a main reference with further details on thistopic and these metrics is the book by Newman on networks theory [32].

3.1 Length of the track

This is the amount of notes, chords or rests composing the track. It is thus theamount of data that is used to generate the net. This measure describes howmuch a performer is inclined to elaborate the melodic line he is creating.

3.2 Number of nodes

This measure is the total amount of nodes in a given network, that correspondsto the number of different notes that have been played during the solo, followingthe approach previously outlined [18]. This metrics gives an idea of the diversityof notes exploited to create the considered melody.

3.3 Number of edges

The total amount of edges in a network is the amount of connections amongnodes in the network. In this specific domain, it measures how many noteshave been played before/after other ones. In this case, the metrics counts theamount of existing links only, without taking into account weights. The higherthis value the higher the amount of different connections that are associated tonodes. Thus, this measure also depends on the number of nodes.

From the number of nodes and edges, measures such as the nodes’ degreeand the network density can be obtained.

3.4 Node degree and degree distribution

The degree of a node x is the amount of links that connect x with other nodesin the network (included x itself, if a self-loop is performed). The degree countshow many times the performer decides playing a note, after (and before) playinganother one. Being the network directed, this measure counts both links enteringa node, as well as links departing from a node. Nodes with higher degrees arenotes that the artist prefers passing through in his melodies, meaning that theconsidered note is played before (after) a high number of other ones.

Given the whole nodes’ degree, it is possible to build a degree distribution,stating how much notes are connected in general. By counting how many nodes

7

Page 8: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

have each degree, we form the degree distribution P (k), defined by

P (k) = fraction of nodes in the network with degree k.

In most cases, insights can be obtained by plotting the degree distribution,both in linear and log-log scales. The linear scale allows understanding if thereis a wide variability on the nodes’ degrees, if some nodes are hubs, meaning thatthese nodes have a large amount of links with other nodes, or rather if nodeshave similar degrees.

Under the circumstance that most nodes have a relatively small degree, buta few nodes have very large degree (hubs), being connected to many other nodes,it is interesting to plot the degree distribution in a log-log scale. This allowsassessing if the degree distribution follows a power law distribution, i.e., theprobability that a node has a degree k is P (k) ∼ k−λ, for some positive valueλ. In fact, it suffices to assess if, in a scatter plot on log-log scale of the degreedistribution, points lie approximately along a line. Networks with power-lawdistributions are called scale-free, since power law distributions have the samefunctional form at all scales [32]. The probability P (k) remains unchanged(other than a multiplicative factor) when rescaling the independent variable k,as it satisfies P (ak) = a−λP (k). In simpler words, scale invariance means thatthe overall features of our network look the same (at least statistically) underdilatations; if we take a degree distribution and zoom in a given portion of it,we would notice that the distribution in that portion has the same trend of theoriginal one, no matter how much we zoom in (similarly to what happens infractals [26, 27]).

3.5 Density

Network density measures how close the network is to be a completely connectednet. In other words, a complete graph has all possible edges among nodes andits density would be equal to 1. The network density is thus measured as

density =#edges

potential connections

where the number of potential connections, in directed nets with self-loops, is#nodes2.

3.6 Average distance

Average distance is the average path length needed to go from one node toanother one in the network. This metrics gives an idea of how complex thesolo is. In fact, larger networks might have higher distances. However, higheraverage distances mean that the player is used to move “locally” among noteshe usually plays together and that, going from one note to another one, a highamount of notes should be traversed, on average. Thus, in the case of musicaltracks, this suggests that the player is used to play “near” notes, i.e., there isa preference to combine certain groups of notes to create the melody. Indeed,the presence of short paths is a revealing factor to assess if a network is a smallworld (as discussed in the remainder of the paper), and this measure should beconsidered together with the clustering coefficient and the network density.

8

Page 9: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Distances can be measured using the directed graph, as well as the undi-rected version of the graph, obtained by removing the direction informationand considering links as bidirectional ones. Clearly enough, distances obtainedfor the undirected networks are usually lower than those of the correspondingdirected ones. Implementations of classic algorithms to compute the distancemeasures in networks are available in many software tools for network analysis,such as those employed in this work, i.e., Gephi [5], Jung [33].

3.7 Diameter

The diameter is the maximum average distance in a network. Also this measurecan provide some insights on the complexity of the melody, similarly to theaverage distance.

3.8 Clustering coefficient

The clustering coefficient is a measure assessing how much nodes in a graph tendto cluster together. Let consider a node x and the neighborhood of x, i.e., theset of nodes that are connected to x. In a clustered network, there is a highprobability that a node in the neighborhood of x is connected to other nodes inthe neighborhood of x [32]. Thus, for instance, in social networks the clusteringcoefficient measures to what extent friends of a node are friends of one anothertoo.

A common way to assess if a network has a high clustering coefficient is tocheck for the presence of triangles in the network, i.e., given two links (x, y),(x, z), sharing the node x, then it is likely that a third link (y, z) exists suchthat the three links form a triangle. Indeed, the clustering coefficient of a netis defined as

C =3 × #triangles

#connected triplets=

#closed triplets

#connected triplets

where we are considering triplets of connected nodes and triangles (or closedtriplets) formed by nodes.

In this domain, the clustering coefficient states how much notes are clustered,i.e., how much the performer plays notes in an interchangeable order, since thereare triplets of notes that are grouped as triangles in the network.

3.9 Betweenness

Betweenness is a centrality measure that indicates if a node has a large influencein the network [18]. It basically measures how often one must pass through agiven node going from an origin to a destination. Thus, betweenness identifiesthose notes the player/composer prefers passing through in his solo/melody.

Betweenness of a node x is defined as

bet(x) =∑

y 6=x 6=z

σyz(x)

σyz,

where σyz is the total amount of shortest paths in the network going from y toz, and σyz(x) is the number of those paths passing through x [18, 32].

9

Page 10: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

3.10 Modularity and community detection

Modularity measures how well a network decomposes into communities. Inother words, it determines if the network can be grouped into sets of nodes,which are densely connected internally. The modularity of a partition is a scalarvalue that measures the density of links inside communities as compared to linksbetween communities. A high modularity score indicates a sophisticated internalstructure, i.e., how the network is compartmentalized into sub-networks. In thecase of weighted networks, it is defined as [9]

Q =1

2m

∑ij

(wij −

kikj2m

)δ(ci, cj)

where wij is the weight of the edge (i, j); ki is the sum of all the weights of edgesattached to node i; ci is the community to which node i belongs; δ() is the deltafunction, i.e., δ(u, v) is 1 if u = v, 0 otherwise; and m = 1

2

∑ij wij . From this

definition, different implementation algorithms can be devised. In this work weemployed the implementation provided in Gephi [5], that follows the algorithmpresented in [9].

In musicological terms, the presence of communities would indicate that themusician is inclined to work with specific groups of notes at a time, in a givenmelody.

4 Practical Examples

4.1 Analysis of some tracks

Figures 3–7 show examples of the network representations of different melodylines, together with their associated degree distribution, plotted in linear andlog-log scales (charts on the right side). In particular, Figure 3 shows the net-work of the solo played by Jimi Hendrix in “Red House”. Figure 4 shows the soloplayed by Miles Davis in “So What”. Figure 5 reports the network of the solo byJohn Coltrane in “Giant Steps”. Figure 6 is the network of the piece “Capriceno. 24” composed by Niccolo Paganini. Figure 7 is the network associated tothe melodic line of the “Flight of the Bumblebee”.

In each network, nodes have labels associated of the form “[pitch/octave/du-ration]” where, as the names say, “pitch” is the pitch of the sound, “octave” isa number counting the octave of the note, and “duration” specifies the relativeduration of the note, with respect to a given bar1.

In the figures, nodes have a size (and label font) that is proportional to thedegree of the node, i.e., the higher the amount of connections the larger the node(and label) size. The color of nodes, instead, is proportional to the measure ofthe betweenness centrality measure; the more the color goes to red the higherthe betweenness of that node. Thus, nodes with a red color and a larger sizereflect important, common notes in the melodic line.

Links are depicted based on their weight, i.e., the larger the line the higherthe weight of that link in the network, meaning that the notes pair connectedthrough that link has been played multiple times.

1A bar (often referred as measure) is a segment of time corresponding to a specific number

10

Page 11: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0

10

20

30

40

50

60

70

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50

frequency

degree

Red House - Degree distribution

1

10

100

1 10 100

frequency

degree

Red House - Degree distribution (log scale)

Figure 3: Jimi Hendrix – Red House

0

5

10

15

20

25

30

35

3 6 9 12 15 18 21 24 27 30 33 36

frequency

degree

So What - Degree distribution

1

10

100

1 10 100

frequency

degree

So What - Degree distribution (log scale)

Figure 4: Miles Davis – So What

11

Page 12: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0

5

10

15

20

25

30

35

40

5 10 15 20 25 30 35 40 45 50 55

frequency

degree

Giant Steps - Degree distribution

1

10

100

1 10 100

frequency

degree

Giant Steps - Degree distribution (log scale)

Figure 5: John Coltrane – Giant Steps

0

20

40

60

80

100

120

140

3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90

frequency

degree

Caprice no. 24 - Degree distribution

1

10

100

1000

1 10 100

frequency

degree

Caprice no. 24 - Degree distribution (log scale)

Figure 6: Niccolo Paganini – Caprice no. 24

12

Page 13: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0

5

10

15

20

25

30

35

40

3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69

frequency

degree

Flight of the Bumblebee - Degree distribution

1

10

100

1 10 100

frequency

degree

Flight of the Bumblebee - Degree distribution (log scale)

Figure 7: Nikolai Rimsky-Korsakov – Flight of the Bumblebee

By looking at the figures, it is clear that rests play an important role inevery song (or solo). If we look at nodes with highest degrees in every depictednetwork, we will find some rest nodes in there.

Some preliminary insights on musical features can be captured by a firstlook of the network. However, a more detailed and deeper analysis would allowto extrapolate more articulated characteristics. We can find some interestingelements by looking at Table 1, which reports measurements of some main met-rics related to networks associated to the tracks considered in Figures 3–7. Foreach network, the table shows the number of network nodes, number of edges,length of the considered track, average degree of the net (“avg deg”), maxi-mum degree (“max deg”), median degree (“median deg”), network diameter(“diam”), average clustering coefficient (“cc”), average path distance (L) andnetwork density.

As already mentioned, the number of network nodes corresponds to theamount of different notes played by a performer in each song melody/solo. Notesof different durations, played at different octaves account for different nodes.Similarly, chords account for single nodes, different to those associated the thesingle notes composing each chord. For this reason, the amount of nodes resultsquite larger than the twelve notes, labeled in the Western tonal music.

The number of edges, the measures concerned with the degrees and thenetwork density assess how much the considered melody/solo has interconnec-tions among notes (the larger values the more varied the use of notes in themelodies). The diameter and the average path distance L are measures con-cerned with distances among nodes. Hence, they give an idea of how manynotes are to be played going from a given note to another, also with respect tothe length of the melody. Finally, as mentioned the clustering coefficient states

of beats in which notes are played. Dividing music into bars provides regular reference pointsto pinpoint locations within a piece of music.

13

Page 14: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

how much notes are played in an interchangeable order and how much they aregrouped in musical phrases.

14

Page 15: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Tab

le1:

Som

em

etri

csfr

omth

en

etw

ork

anal

ysi

s:fo

rea

chso

ng

the

rep

ort

edm

etri

csare

the

nu

mb

erof

net

work

nod

es,

nu

mb

erof

edges

,le

ngt

hof

the

con

sid

ered

trac

k,

aver

age

deg

ree

of

the

net

(“av

gd

eg”),

maxim

um

deg

ree

(“m

ax

deg

”),

med

ian

deg

ree

(“m

edia

ndeg

”),

net

wor

kd

iam

eter

(“d

iam

”),

aver

age

clu

ster

ing

coeffi

cien

t(“

cc”),

aver

age

path

dis

tan

ce(L

),n

etw

ork

den

sity

.

track

#nodes

#edges

length

avgdeg

maxdeg

median

deg

diam

cc

Ldensity

J.Hendrix–Red

House

148

458

802

6.19

47

415

0.16

4.5

0.02

M.Davis

–SoW

hat

68

230

305

6.77

35

37

0.21

3.18

0.05

J.Coltra

ne–GiantSteps

83

459

1507

11

51

616

0.3

4.1

0.07

N.Paganini–Capriceno.24

257

754

1331

5.87

89

322

0.14

5.24

0.01

N.Rim

sky-K

orsakov–Flightofth

eBumblebee

79

215

1393

5.44

68

411

0.14

3.65

0.04

15

Page 16: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

The solo by Jimi Hendrix in “Red House” (Figure 3) denotes a certain com-plexity of the network, with prominent notes having a pitch among A#, D#,F. Indeed, the song is a blues played in the A# key and these three notes arethe tonic2 of the main song chords. The charts related to the degree distribu-tion witness a wide variability on the nodes’ degrees. In particular, the mediandegree is 4, the average degree is around 6, while the highest degree is 47 (asreported in Table 1). The log-log scale chart in Figure 3 shows that degrees lieapproximately along a line; thus, the network is a scale-free. The network iscomposed of a relatively high number of nodes (with respect to other consid-ered network exemplars); this means that there might be several notes with thesame pitch, but different durations. The higher number of nodes correspondsto a lower density than other nets (apart from “Caprice no. 24”, which is thelargest considered net) and a high diameter (Table 1). However, the averagedegree and average path distance are low, and the clustering coefficient has asignificant (but not excessive) value. These values might be explained if weconsider that we are dealing with a classic electric blues guitar player, playingover a classic blues. It is well known in musicology that (non-jazzy) blues play-ers employ a simple underlying chord structure, and the associated referencescales are limited in number. Nevertheless, the melody is quite intricate andsyncopated. Moreover, the player here employs a high number of bi-chords (i.e.,two notes played simultaneously), that increase the final number of nodes in thenetwork.

The solo by Miles Davis in “So What” (Figure 4) has a simpler structurewith respect to other networks. Rests are largely employed and are central in thenetwork (high betweenness). Indeed, music experts quite often discuss on theability of Miles Davis to use silence periods in his solos. His famous quotation

2In music, the “tonic” is the first scale degree of a diatonic scale. It is thus the tonal centerof a given key; in other words, it is the main note of that key.

16

Page 17: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

“It’s not the notes you play, it’s the notes you don’t play” surely confirms thisclaim. According to the degree distributions, despite the lower amount of nodes,the degree distribution seems to follow a power law, making the net a scale-free.In Table 1 it is possible to appreciate that this simple structure is reflectedon the reported metrics, i.e., lower number of nodes, edges, average distance,maximum and median degrees. These values are mainly due by the shorterlength of this solo. The low amount of nodes corresponds to a higher clusteringcoefficient and network density, meaning that the player combines these nodesin different orders during his solo.

“Giant Steps” solo is quite complex (Figure 5); many music excerpts havebeen written to analyze this solo. The network reveals this complexity. Theharmonic structure of the track is based on three main keys, i.e., D#, G,B.Important nodes in the network are related to the tonic notes of these keys, orthe dominant notes3, i.e., A# forD#, F# forB. Also this network is a scale-freeone, as confirmed by the shape of the degree distribution in Figure 5 (left charts).Metrics reported in Table 1 provide some important insights. In fact, while thesolo of “Giant Steps” has a high length w.r.t. other considered exemplars, itsnumber of nodes is relatively lower. This means that, for instance, in “GiantSteps” the amount of nodes (i.e., notes with a given pitch and duration) playedby Coltrane is lower than the number of (nodes, and thus) notes played byHendrix in “Red House” (which has a lower length also). All this, despite thefact that the solo in “Giant Steps” is considered as a particularly complicatedone, due to the complex underlying harmony and the complex melody thatColtrane builds on top of it. Anyway, the amount of edges is the same (oneunit higher, actually) of “Red House”. This means that these notes are widelyinterconnected, and this results in an intricate and complex melody. Indeed,the complexity of this track is confirmed by the highest average degree, highmedian degree, the high diameter, average path length and network density.

“Caprice no. 24” has the highest amount of nodes and number of edges, witha limited average degree. In fact, apart from some rests, no specific notes appearto have a main role, with respect to others (Figure 6). In this case, rests have thehighest degrees and betweenness values. The net has a scale-free structure. Asshown in Table 1, the average degree is lower than other considered networks, aswell as the median degree and the average distance. The fact that this net showsthe highest maximum degree (w.r.t. other networks) witnesses the importanceof the hubs, which are indeed rest notes. The diameter is quite high, due to thelargest network size; this is confirmed by the low network density. In substance,the importance of rests, the low median degree, network density and clusteringcoefficient confirm a linear structure of this classical composition.

As concerns “The Flight of the Bumblebee”, the main role of a very shortrest (rest 64th) is evident from Figure 7. The corresponding node has thehighest degree and highest betweenness value. Moreover, the network revealsa presence of recurrent sequences of note pairs. There are several links withhigh weights, and these note pairs appear to be organized as a chain. Indeed,this track is characterized by repetitions of chromatic sequences of notes, andthis is confirmed by the network structure. In this case, the degree distributionsuggests that this network does not follow a power law; thus, the net does not

3In music, the “dominant” note in a given key is the fifth scale degree of the diatonic scale:It is called dominant because it is next in importance to the tonic.

17

Page 18: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

show a scale-free property. All these considerations are confirmed by the valuesin Table 1. In fact, despite the long duration of the track, the network has alow number of nodes, edges, but a not so high diameter, due to the fact thatthe “rest 64th” node plays the role of hub, connecting different portions of thenetwork. The long duration of the track (length) and the high weights of theedges confirm (for those that do have a musical knowledge of the track) thatthe track has a repetitive structure in the melody.

Table 2: Small world property: comparison between the clustering coefficient(column “cc”) and the average distance (column L) of the considered undi-rected network, with the clustering coefficient (column “cc (RG)”) and theaverage distance (column LRG) of the corresponding random graph. The lastcolumn shows the small coefficient as defined in Equation 1; basically, the smallproperty exists when σ � 1.

track cc cc (RG) L LRG σ

J. Hendrix – Red House 0.24 0.02 3.37 5.00 17.8M. Davis – So What 0.32 0.05 2.51 4.22 10.7J. Coltrane – Giant Steps 0.40 0.07 4.56 4.42 5.5N. Paganini – Caprice no. 24 0.20 0.01 3.71 5.55 29.9N. Rimsky-Korsakov – Flight of the Bumblebee 0.25 0.03 2.60 4.37 14E. Clapton (Cream) – Crossroads (2nd solo) 0.40 0.04 3.68 4.29 11.6B.B. King – Worried Life Blues 0.09 0.05 3.04 3.58 2.1Pink Floyd – Comfortably numb (1st solo) 0.06 0.03 4.30 4.03 1.9

4.2 Small world property

Table 2 shows an analysis of some specific solos, aimed at assessing if the relatednetworks exhibit a small word property. In simple words, when a network isidentified as a small world, we can conclude that the related solo is composed ofa sequence of nodes which are combined and played in various orders (i.e., wecan identify subsets of nodes in the net that are highly interconnected amongthemselves), with a significant amount of connections between notes that are indifferent clusters (or, in some sense, in different “areas” of the network) [18]. Asmall world is a highly clustered net with a small average path length.

To mathematically assess these features, a method is to compare the networkagainst a graph of the same size, where node links are randomly generated[32]. In this case, in order to be a “small world” the network should have a(small) average distance comparable to that of the considered random graph,but a significantly higher clustering coefficient. In particular, if one looks atthe clustering coefficient (cc) together with the average distance (L) of theconsidered network (note than in this case we ignore the directed nature of thelinks, thus obtaining an undirected network [32]), and the clustering coefficient(ccRG) together with the average distance (LRG) of the corresponding randomgraph, we can measure the small-coefficient as

σ =cc/ccRGL/LRG

, (1)

concluding that the network can be classified as a small world when σ is signif-icantly higher than 1 [22].

18

Page 19: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

From Table 2, we can appreciate that all the considered solos have a corre-sponding value of the coefficient σ higher than 1; thus, in general they might beconsidered as small worlds. As a matter of fact, a comparison has been madeon musical solos of a set of different guitar players [18]. From the databaseconsidered in [18], we measured the value of σ and found that all these solosfeature a value σ > 1. However, while the majority of solos has a σ significantlyhigher than 1, others exist having a σ value near 1. Two examples, reportedin Table 2 (two last rows), are the solo played by D. Gilmour (Pink Floyd)in “Comfortably numb (1st solo)” and “Worried Life Blues” by B.B. King. Infact, these two solos are poorly clustered with respect to other examples. In-deed, the corresponding music melodies can be considered as linear, “melodic”ones. Thus, in these two cases a small world property is not fully evident.

4.3 Modularity

We already mentioned that through the measure of modularity we can under-stand if it is possible to decompose a network into communities. This wouldindicate that the performer is inclined to work with specific groups of notes ata time, in a given melody.

To better understand if and when melodies can be partitioned into subsetsof notes, we considered the networks already described, but rest notes wereremoved from the network. In fact, rests have the role of separating musicalnotes and their removal enhances the partitioning of communities. Indeed, afterthis removal, in certain cases some notes communities are not connected tothe rest of the network, meaning that they were played within music intervalsdelimited by rests. Table 3 shows the modularity value for these networks,measured using the approach described in [9] and implemented in Gephi [5],together with the amount of identified communities. The higher the modularityvalue the more evident the presence of communities in each network. In general,we can see that a community-based structure is more evident in classical tracks,i.e., Caprice no. 24 and the Flight of the Bumblebee, where modularity valuesare higher, as well as the amount of communities (even in these two cases somecommunities are related to isolated notes). Conversely, it is more difficult todivide the network into communities for the jazz solo in Giant Steps.

Table 3: Modularity: for each track the modularity measure is reported (thehigher the value the more evident the presence of communities), together withthe amount of communities. Rests have been removed from the tracks.

track modularity # communities

J. Hendrix – Red House 0.49 9

M. Davis – So What 0.46 12

J. Coltrane – Giant Steps 0.35 5

N. Paganini – Caprice no. 24 0.62 23

N. Rimsky-Korsakov – Flight of the Bumblebee 0.68 19

This result can be appreciated also by looking at Figures 8–12. Each figurecorresponds to a track. On the left side, a pictorial representation of the net-work is reported, where rests have been removed and nodes have been arrangedin the layout and colored according to their community (thus, while networks

19

Page 20: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Figure 8: Modularity – Jimi Hendrix; Red House. Rests have been removedfrom the track; nodes are colored according to their community.

are the same of the previous ones without rests, the layout and their resultingappearance are different). On the right side, the chart reports the size distribu-tion of each community in the network, i.e., number of nodes composing eachcommunity.

Figure 8 shows the network associated to the solo of J. Hendrix in the “RedHouse” track, with nodes organized in communities. The network has severalcommunities composed of a single node. It is possible to notice that even ifsome communities appear to be densely connected, an important amount ofinter-community links exists. This is confirmed by the limited modularity valuereported in Table 3 for that track. We have a similar outcome for the soloplayed by M. Davis in “So What” (Figure 9). In this case, there are severalcommunities that refer to isolated nodes, meaning that the musician played thecorresponding notes alone, placing rests before and after that note.

A “non-community structure” is even more evident in “Giant Steps” (Figure10). Few communities are identified and the modularity value is lower than otherconsidered networks (see Table 3). In this case, the inter-community links arequite high; thus, the modularity algorithm fails in identifying sub-communities,which are indeed not present in the network.

A different outcome is obtained for the classical tracks “Caprice no. 24”(Figure 11) and “Flight of the Bumblebee” (Figure 12). In this case, the mo-dularity values are higher than others, as confirmed in Table 3. Moreover, thenetwork figures reveal a community-based structure, with few links connectingdifferent communities. Also in this case, there are several isolated notes, orgroups of notes, meaning that these are confined by two rests preceding andfollowing them.

In conclusion, the study on modularity reveals that different tracks havedifferent outcomes in terms of partitioning into communities. The consideredclassical tracks do have a community structure, while this aspect is not that

20

Page 21: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Figure 9: Modularity – Miles Davis; So What. Rests have been removed fromthe track; nodes are colored according to their community.

Figure 10: Modularity – John Coltrane; Giant Steps. Rests have been removedfrom the track; nodes are colored according to their community.

21

Page 22: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

Figure 11: Modularity – Niccolo Paganini; Caprice no. 24. Rests have beenremoved from the track; nodes are colored according to their community.

Figure 12: Modularity – Nikolai Rimsky-Korsakov; Flight of the Bumblebee.Rests have been removed from the track; nodes are colored according to theircommunity.

22

Page 23: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0 500 1000 1500

0.0

00

00

.00

05

0.0

01

00

.00

15

0.0

02

0Length of solos distribution

Length

De

nsity

0 500 1000 1500

0.0

0.2

0.4

0.6

0.8

1.0

Length of solos cumulative distribution

Length

Pro

ba

bili

ty

Figure 13: Length of solo distribution

evident in other (jazz) tracks. An interesting question is whether this featuredepends on the music genre. The aim of this study was to demonstrate thata number of musical features can be obtained from a network-based analysis.The low number of considered tracks does not allow answering this question.Anyway, this analysis methodology can be employed to make detailed studieson the musical characteristics of different songs or melodies in general.

5 Experimental Evaluation

This section shows aggregate results of some main metrics of interest relatedto the network-based analysis of musical tracks. The employed data set is abunch of a large set of musical solos of different guitar players [18]. Scores wereretrieved from Web sites (e.g. A-Z Guitar Tabs) in Guitar Pro or Power Tab for-mats. Thanks to the PyGuitarPro python library [3], and an own made (Pythonand Java) software, solo guitar parts were isolated, exported to a musicXMLformat [2], and then exploited to create a network representation of the melodicline.

5.1 Density and Cumulative Distribution of Metrics of In-terest

We focus here on the density and cumulative distributions of the previouslyconsidered network metrics.

Figure 13 shows the density distribution and the cumulative distribution ofthe length of the considered solos. As mentioned, this metrics corresponds to thenumber of notes composing each solo. The density distribution (left-most chart)has a peak, with a heavy tail on the right part of the chart. This demonstratesthat a variable amount of notes is played during a melodic line such as a musicalsolo. The same outcome is confirmed by the cumulative distribution (right-mostchart), showing a slow rise above 0.8.

Figure 14 shows the distribution of the amount of nodes. It is possible to

23

Page 24: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0 50 100 150 200 250

0.0

00

0.0

02

0.0

04

0.0

06

0.0

08

0.0

10

0.0

12

Average # nodes distribution

# nodes

De

nsity

0 50 100 150 200

0.0

0.2

0.4

0.6

0.8

1.0

Average # nodes cumulative distribution

# nodes

Pro

ba

bili

ty

Figure 14: Average number of nodes distribution

2 4 6 8 10

0.0

00

.05

0.1

00

.15

0.2

0

Average degree distribution

degree

De

nsity

2 4 6 8 10

0.0

0.2

0.4

0.6

0.8

1.0

Average degree cumulative distribution

degree

Pro

ba

bili

ty

Figure 15: Average degree distribution

notice a similar trend to the previous chart, even if values are lower. Indeed,the two considered metrics are somehow correlated, since in a melodic line thesame note/node is usually played more that once.

Figure 15 shows the distribution of the average degree of networks obtainedfrom the considered melodic lines. The average degree distribution has a peakvalue around 4 and the average degrees lie in general between 2 and 11. Avery similar trend is evident when looking at in-degrees degrees (not reportedhere). This outcome demonstrates that in a melody notes are played before/aftermultiple other ones in a melody, confirming that a peculiar (and well known)aspect of the construction of a melody is on how to combine notes.

Figure 16 shows the density and cumulative distributions of normalized de-grees. In this case, the bell curve of the density distribution is more narrowwith respect to the average degree; a large tail is present for higher values.

Figure 17 shows the density and cumulative distributions of the average

24

Page 25: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0.00 0.05 0.10 0.15 0.20 0.25 0.30

02

46

81

01

2

Average normalized degree distribution

normalized degree

De

nsity

0.00 0.05 0.10 0.15 0.20 0.25 0.30

0.0

0.2

0.4

0.6

0.8

1.0

Average normalized degree cumulative distribution

normalized degree

Pro

ba

bili

ty

Figure 16: Average normalized degree distribution

2 3 4 5 6 7 8

0.0

0.1

0.2

0.3

0.4

0.5

Average undirected distance distribution

distance

De

nsity

2 3 4 5 6 7 8

0.0

0.2

0.4

0.6

0.8

1.0

Average undirected distance cumulative distribution

distance

Pro

ba

bili

ty

Figure 17: Undirected distance distribution

25

Page 26: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0.0 0.1 0.2 0.3 0.4 0.5 0.6

01

23

45

Clustering coefficient distribution

σ

De

nsity

0.1 0.2 0.3 0.4 0.5

0.0

0.2

0.4

0.6

0.8

1.0

Clustering coefficient cumulative distribution

σ

Pro

ba

bili

ty

Figure 18: Clustering coefficient distribution

undirected distances of nodes in the considered nets. Again, density distributionis a bell curve with a larger tail for higher distance values. The cumulativedistribution confirms that musical networks have a low average path length,in general. For instance, the 60% of the considered networks has an averagedistance among nodes which is lower than 4. This means that, in the consideredmelodic lines played/generated by the the musicians/composers, the majorityof exploited notes are not far away from others.

Figure 18 is concerned with the distribution of the clustering coefficients.We already mentioned that the clustering coefficient states how much notes areclustered, i.e., how much the performer plays notes in an interchangeable order.This value is comprised between 0 and 1, where 0 means that no triangles arepresent in the network, i.e., notes are played in a specific sequence, and 1 meansthat all triplets of nodes form a triangle, i.e., all triplets of notes of the melodyare played in all possible orders. In a network representing a melody, it isunlikely to have a fully connected network with an overall clustering coefficientequal to 1. Thus, a peak around 0.3 in the density distribution of the clusteringcoefficient confirms that melodies are well clustered. This is in accordance tothe specific network/melody exemplars analyzed in Section 4.

Finally, Figure 19 reports the density and cumulative distributions of thesmall world σ values (σ > 1 implies that the network is a small world). Thecharts confirm that almost all melodies/solos exhibit the small world property,meaning that it is a general trend to exploit locality in the networks (i.e., groupsof notes are played in an interchangeable order in the melody), but there arelinks (sequences of two notes) connecting more distant groups of notes in the net.Such connecting links might include the so called “passing notes”, i.e. melodicembellishments that occur between two stable notes (typically chord tones),creating stepwise motion.

All these results demonstrate that these networks have common properties ingeneral, however with some differences that can be studied and used to charac-terize the peculiarity of a song, a musician or composer. For instance, clusteringtechniques, or alternative machine learning approaches, might be employed toidentify those musical tracks (or musicians) that have similar musical traits.

26

Page 27: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

0 5 10 15 20 25 30

0.0

00

.02

0.0

40

.06

0.0

8Small world distribution

σ

De

nsity

0 5 10 15 20 25

0.0

0.2

0.4

0.6

0.8

1.0

Small world cumulative distribution

σ

Pro

ba

bili

ty

Figure 19: Small World σ value distribution

5.2 Comparison with Real Networks

Table 4: Comparison among some musical networks and some well known realnetworks, of similar size.

network #nodes avg deg σ

J. Hendrix – Red House 148 6.19 17.8J. Hendrix – Voodoo Child (Slight Return) – Woodstock 222 5.98 32.7N. Paganini – Caprice no. 24 257 5.87 29.9

E. Coli – substrate graph [14] 282 7.35 12.9Silwood Park food web [31] 154 4.75 4.7C. Elegans [39] 282 14 4.7

Table 4 compares three musical networks (first rows of the table) with threereal networks that have been widely analyzed in the complex networks literature(latest three rows of the table). These specific six networks were selected dueto their similar size in terms of number of nodes (see “#nodes” column in thetable).

The three musical networks are the two already considered tracks “RedHouse” and “Caprice no. 24”, plus the network obtained from the first soloimprovisation performed by J. Hendrix, over the song “Voodoo Child (SlightReturn)”, during his famous performance at Woodstock in 1969.

The other considered three networks are very diverse in nature. The first oneis the substrate graph of the Escherichia Coli, where nodes represent chemicalcompounds, which are connected in the network when they occur (either assubstrates or products) in the same chemical reaction [14]. The “Silwood Parkfood web” is a graph representation of the predatory interactions among speciesin the Silwood Park environment. Each node represents a species, and a directedlink is drawn from i to j when species j preys on species i [31]. Finally, theneural network of the nematode worm Caenorhabditis elegans is an importantexample of a completely mapped neural network. Nodes are neurons, and a linkjoins two neurons if they are connected by either a synapse or a gap junction[39].

27

Page 28: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

While a detailed comparison is out of the scope of this paper, the rationalehere is to emphasize that very diverse networks may have similar mathematicalproperties. In fact, the average degree for these networks is comparable, in therange of approximately 4.5 up to 7.5, with the exception of the “C. Elegans”net, which has a higher value than others, i.e., 14. However, in the previouscharts it has been shown guitar solos in the considered dataset have an averagedegree equal or higher than 10. Moreover, the table shows that all these differentnetworks are small worlds; in fact, the σ value is well above 1 in all cases, thusdemonstrating this common property for all of them.

This result shows that musical networks have structural properties similarto other complex networks, which model very diverse physical or biologic phe-nomena. This is a common trend in the graph modeling of real systems, whichsuggests that further reasoning, typical of complex network theory, can be pro-ficiently applied to music as well.

6 Conclusions

In this paper we discussed an approach to model melodies as networks. Accord-ing to the model, notes of a melody are treated as network nodes, and links areadded between two nodes when the related notes are played in succession. Thepictorial representation of the network gives an idea on the network structureand its related track. However, it is possible to extract several metrics thatprovide interesting insights on the melody and its musical characteristics. Onecan thus look at the length of the melody, node degrees and their distribution,average distance, betweenness, network density, clustering coefficient, modular-ity and so on. We can also understand which are the main notes in the network(melody) structure.

In general, we saw that melodies and solos, which are classified by musicexperts as very sophisticated ones, do have a corresponding complex networkstructure. This is true, as an example, for the solo by J. Coltrane in “GiantSteps”. Results suggest that most melodic networks are small worlds and exhibita scale-free network structure.

Rests play an important role in music, regardless of the music genre orinstrument being used (this is a confirmation of a straightforward, well knownmusical claim). Not surprisingly, rests play the role of hubs in many networksand may have high betweenness values.

Intricate melodies, typical of modern music, have a wide node degree distri-bution, with high median and average degrees, a high clustering coefficient, withsome edge weights significantly higher than others. Conversely, the consideredclassical tracks, while recognized as very difficult from an execution point ofview, have a more linear structure. In this case, the amount of hubs is lower,while certain edges have a high weight.

The two considered classical tracks have a high modularity value. With-out rests, the networks have several isolated nodes and a clear organization incommunities. Such a feature is not that evident in other tracks.

The use of a mathematical modeling of a music track provides a generaland compact way to analyze music. This model can be of help in capturingthe artistic traits of a musician, a music genre, the typical melodies obtainedthrough a specific instrument, and so on. The application scenarios are related

28

Page 29: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

to the classification and categorization of music. Similarity and clustering ofmusical tracks can be performed by comparing the mentioned metrics, as wellas by employing more sophisticated network similarity algorithms [13, 18, 37].

Moreover, the proposed framework can be exploited as a tool during theautomatic generation of music. For instance, let consider the case of gener-ating a melody whose style resembles that of a given musician. The idea isthat the networks’ structure, together with the main parameters that describethese nets, can be employed to identify main motifs and peculiar characteris-tics of the musician. These can be utilized as inputs and used together withmodern machine learning techniques to generate melodies, whose structure re-flects the peculiar aspects of networks generated by the artist [29]. Such anapproach might have interesting applications in music didactics, multimedia en-tertainment, and digital music generation. All these applications are regardedas future work. In these scenarios, it will be also interesting to understandwhether the representation of a music score as a network introduces additionalbenefits in these specific use cases, besides the possibility to characterize musicand artists through a mathematical description.

References

[1] Math - Commons-Math: The Apache Commons Mathematics Library.

[2] musicxml web site, http://www.musicxml.com/.

[3] Pyguitarpro web site.

[4] D. G. Angeler. Heavy metal music meets complexity and sustainabilityscience. SpringerPlus, 5(1):1637, 2016.

[5] M. Bastian, S. Heymann, and M. Jacomy. Gephi: An open source softwarefor exploring and manipulating networks. 2009.

[6] C. Bell. Algorithmic music composition using dynamic markov chains andgenetic algorithms. J. Comput. Sci. Coll., 27(2):99–107, Dec. 2011.

[7] A. Berenzweig, B. Logan, D. P. W. Ellis, and B. P. W. Whitman. Alarge-scale evaluation of acoustic and subjective music-similarity measures.Comput. Music J., 28(2):63–76, June 2004.

[8] C. Biemann, S. Roos, and K. Weihe. Quantifying semantics using com-plex network analysis. In COLING 2012, 24th International Conferenceon Computational Linguistics, Proceedings of the Conference: TechnicalPapers, 8-15 December 2012, Mumbai, India, pages 263–278, 2012.

[9] V. D. Blondel, J.-L. Guillaume, R. Lambiotte, and E. Lefebvre. Fast un-folding of communities in large networks. Journal of Statistical Mechanics:Theory and Experiment, 2008(10):P10008, 2008.

[10] S. Boccaletti, V. Latora, Y. Moreno, M. Chavez, and D.-U. Hwang. Com-plex networks: Structure and dynamics. Physics Reports, 424(4–5):175 –308, 2006.

29

Page 30: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

[11] R. F. i. Cancho and R. V. Sole. The small world of human lan-guage. Proceedings of the Royal Society of London B: Biological Sciences,268(1482):2261–2265, 2001.

[12] J. Cong and H. Liu. Approaching human language with complex networks.Physics of Life Reviews, 11(4):598 – 618, 2014.

[13] A. P. Cootes, S. H. Muggleton, and M. J. Sternberg. The Identification ofSimilarities between Biological Networks: Application to the Metabolomeand Interactome. Journal of Molecular Biology, 369(4):1126–1139, June2007.

[14] D. A. Fell and A. Wagner. The small world of metabolism. Nat Biotech,18(11):1121–1122, Nov 2000.

[15] S. Ferretti. Gossiping for resource discovering: An analysis based on com-plex network theory. Future Generation Computer Systems, 29(6):1631 –1644, 2013.

[16] S. Ferretti. Shaping opportunistic networks. Computer Communications,36(5):481–503, 2013.

[17] S. Ferretti. Guitar solos as networks. In 2016 IEEE International Confer-ence on Multimedia and Expo (ICME), pages 1–6, July 2016.

[18] S. Ferretti. On the modeling of musical solos as complex networks. Infor-mation Sciences, 375:271 – 295, 2017.

[19] Z. Fu, G. Lu, K. M. Ting, and D. Zhang. A survey of audio-based musicclassification and annotation. Trans. Multi., 13(2):303–319, Apr. 2011.

[20] I. Grabska-Gradzinska, A. Kulig, J. Kwapien, and S. Drozdz. Complexnetwork analysis of literary and scientific texts. International Journal ofModern Physics C, 23(07), 2012.

[21] M. Granroth-Wilding and M. Steedman. A robust parser-interpreter forjazz chord sequences. Journal of New Music Research, 0(0):1–20, 2014.

[22] M. D. Humphries and K. Gurney. Network ‘small-world-ness’: A quantita-tive method for determining canonical network equivalence. PLOS ONE,3(4):1–10, 04 2008.

[23] R. Keller, A. Schofield, A. Toman-Yih, Z. Merritt, and J. Elliott. Automat-ing the explanation of jazz chord progressions using idiomatic analysis.Computer Music Journal, 37(4):54–69, 2013.

[24] I. Knopke and F. Jurgensen. chapter Symbolic Data Mining in Musicol-ogy, pages 327–345. Chapman & Hall/CRC Data Mining and KnowledgeDiscovery Series. CRC Press, Jul 2011. 0.

[25] R. Lichtenwalter, K. Lichtenwalter, and N. V. Chawla. A machine-learning approach to autonomous music composition. J. Intelligent Sys-tems, 19(2):95–124, 2010.

30

Page 31: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

[26] S. Liu, W. Fu, L. He, J. Zhou, and M. Ma. Distribution of primaryadditional errors in fractal encoding method. Multimedia Tools Appl.,76(4):5787–5802, Feb. 2017.

[27] S. Liu, Z. Zhang, L. Qi, and M. Ma. A fractal image encoding method basedon statistical loss used in agricultural image compression. Multimedia ToolsAppl., 75(23):15525–15536, Dec. 2016.

[28] X. F. Liu, C. K. Tse, and M. Small. Complex network structure of musi-cal compositions: Algorithmic generation of appealing music. Physica A:Statistical Mechanics and its Applications, 389(1):126 – 132, 2010.

[29] Y. Liu, L. Nie, L. Liu, and D. S. Rosenblum. From action to activity:Sensor-based activity recognition. Neurocomputing, 181:108 – 115, 2016.Big Data Driven Intelligent Transportation Systems.

[30] B. Manaris, J. Romero, P. Machado, D. Krehbiel, T. Hirzel, W. Pharr,and R. B. Davis. Zipf’s law, music classification, and aesthetics. Comput.Music J., 29(1):55–69, Feb. 2005.

[31] J. M. MONTOYA and R. V. SOLE. Small world patterns in food webs.Journal of Theoretical Biology, 214(3):405 – 412, 2002.

[32] M. Newman. Networks: An Introduction. Oxford University Press, Inc.,New York, NY, USA, 2010.

[33] J. O’Madadhain, D. Fisher, S. White, and Y. Boey. The JUNG (JavaUniversal Network/Graph) Framework. Technical report, UCI-ICS, Oct.2003.

[34] A. v. d. Oord, S. Dieleman, and B. Schrauwen. Deep content-based musicrecommendation. In Proceedings of the 26th International Conference onNeural Information Processing Systems, NIPS’13, pages 2643–2651, USA,2013. Curran Associates Inc.

[35] T. Pardo, L. Antiqueira, M. das Gracas Nunes, O. N. Oliveira, andL. da Fontoura Costa. Using complex networks for language processing:The case of summary evaluation. In Communications, Circuits and SystemsProceedings, 2006 International Conference on, volume 4, pages 2678–2682,June 2006.

[36] B. G. Patra, D. Das, and S. Bandyopadhyay. Unsupervised approach tohindi music mood classification. In Proceedings of the First InternationalConference on Mining Intelligence and Knowledge Exploration - Volume8284, MIKE 2013, pages 62–69, New York, NY, USA, 2013. Springer-VerlagNew York, Inc.

[37] N. Shah, D. Koutra, T. Zou, B. Gallagher, and C. Faloutsos. TimeCrunch:Interpretable Dynamic Graph Summarization. In Proceedings of the 21stACM International Conference on Knowledge Discovery and Data Mining(SIGKDD), 2015.

[38] J. Thickstun, Z. Harchaoui, and S. Kakade. Learning features of musicfrom scratch. In preprint, https://arxiv.org/abs/1611.09827, 2016.

31

Page 32: Stefano Ferretti arXiv:1709.09708v1 [cs.SD] 13 Sep 2017

[39] D. J. Watts and S. H. Strogatz. Collective dynamics of’small-world’networks. Nature, 393(6684):409–10, 1998.

[40] C. Yan, Y. Zhang, J. Xu, F. Dai, L. Li, Q. Dai, and F. Wu. A highlyparallel framework for hevc coding unit partitioning tree decision on many-core processors. IEEE Signal Processing Letters, 21(5):573–576, May 2014.

[41] C. Yan, Y. Zhang, J. Xu, F. Dai, J. Zhang, Q. Dai, and F. Wu. Efficient par-allel framework for hevc motion estimation on many-core processors. IEEETransactions on Circuits and Systems for Video Technology, 24(12):2077–2089, Dec 2014.

[42] S. Zhao, H. Yao, F. Wang, X. Jiang, and W. Zhang. Emotion based imagemusicalization. In 2014 IEEE International Conference on Multimedia andExpo Workshops (ICMEW), pages 1–6, July 2014.

32