Network of Musical Instruments for Rhythm Accompaniment

Chrysavgi Chatzimichail, BA 
avgi@hcsl . com
Aristides T . Hatjimihail, MD, PhD
ath@hcsl . com

Hellenic Complex Systems Laboratory, Kostis Palamas 21, 66131 Drama, Greece .

Initialization Code

data={{{"guitar"},19},{{"harpsichord"},5},{{"guitar" , "baglamas"},4},{{"guitar" , "toumperleki"},3},{{"spoon drums"},3},{{"bendir"},3},{{"guitar" , "kompoloi-glass"},2},{{"guitar" , "spoon drums"},2},{{"guitar" , "zither"},1},{{"guitar" , "harpsichord"},3},{{"oud","spoon drums"},2},{{"oud" , "toumperleki"},2},{{"glass"},2},{{"saz" ,"bendir"},2},{{"toumperleki"},2},{{"toumperleki" ,"zil"},2},{{"accordion" ,"lute" ,"davul" ,"spoon drums"},1},{{"guitar" ,"accordion" ,"spoon drums"},1},{{"guitar" ,"castanets"},1},{{"guitar" ,"triangle"},1},{{"guitar" ,"bendir"},1},{{"guitar" ,"tambourine"},1},{{"guitar" ,"glass"},1},{{"guitar","spoon drums" ,"zil"},1},{{"guitar","baglamas" ,"maracas"},1},{{"guitar","baglamas" ,"contrabass"},1},{{"guitar","baglamas" ,"bendir"},1},{{"guitar","baglamas" ,"toumperleki"},1},{{"guitar","contrabass" ,"zil"},1},{{"guitar","contrabass","bendir" ,"spoon drums"},1},{{"guitar","bendir" ,"contrabass"},1},{{"guitar","glass","maracas","spoon drums" ,"tambourine"},1},{{"guitar","toumperleki" ,"zil"},1},{{"guitar","toumperleki" ,"contrabass"},1},{{"guitar","toumperleki" ,"glass"},1},{{"guitar","castanets" ,"glass"},1},{{"lute"},1},{{"lute" ,"zither"},1},{{"lute" ,"toumperleki"},1},{{"baglamas","guitar" ,"contrabass"},1},{{"baglamas","contrabass" ,"synthesizer"},1},{{"contrabass","drums","electric guitar" ,"tambourine"},1},{{"contrabass","toumperleki" ,"bendir"},1},{{"contrabass","toumperleki" ,"zil"},1},{{"contrabass","toumperleki" ,"drums"},1},{{"ney","crotalums" ,"maracas"},1},{{"davul" ,"glass"},1},{{"davul","tabla","toumperleki" ,"tambourine"},1},{{"oud"},1},{{"oud" ,"bendir\[Hyphen]zil"},1},{{"oud","toumperleki" ,"spoon drums"},1},{{"oud","toumperleki" ,"bendir"},1},{{"guitar","baglamas" ,"toumperleki","tambourine"},1},{{"saz","bendir" ,"baglamas"},1},{{"zither" ,"spoon drums"},1},{{"synthesizer","guitar" ,"contrabass"},1},{{"toumperleki" ,"bendir\[Hyphen]zil"},1},{{"voice"},1},{{"voice" ,"bendir"},1}};

fdata=Flatten[Map[ConstantArray[#[[1]],#[[2]]]&,data],1];

sfdata=DeleteDuplicates[Flatten[fdata]];

paired[a_,b_,l_List]:=MemberQ[Map[ContainsAll[#,{a,b}]&,l],True]

single[a_,l_List]:=MemberQ[Map[ContainsExactly[#,{a}]&,l],True]

graph=RelationGraph[((paired[#1,#2,fdata]&&UnsameQ[#1,#2])||(single[#1,fdata]&&SameQ[#1,#2]))&,sfdata];

efreq[loa_,edge_]:=If[SubsetQ[loa[[1]],edge],loa[[2]],0]

instrWeight[org_]:=Apply[Plus,Map[efreq[#,org]&,data]]

weightList[ol_]:=Map[instrWeight[#]&, ol]

edgeWeights=weightList[Map[Apply[List,#]&,EdgeList[graph]]];

wGraph=RelationGraph[((paired[#1,#2,fdata]&&UnsameQ[#1,#2])||(single[#1,fdata]&&SameQ[#1,#2]))&,sfdata,VertexLabels->Placed["Name",Center],VertexLabelStyle->Directive[Italic, 10],EdgeWeight->edgeWeights,ImageSize->{750,500}];

measuresTable[l_]:=Pane[Text@Grid[Sort[MapThread[List,{sfdata,If[Apply[And,FractionalPart[#]==0&/@l],l,Map[NumberForm[#,{3,4}]&,N@l]]}],#1[[2]]>#2[[2]]&], Alignment->{{Left,"."}},Spacings->{5,0}],ImageSize->{750,500}]

measuresList[l_]:= Sort[MapThread[List,{sfdata,l}],#1[[2]]>#2[[2]]&]

measuresPlot[l_]:=ListPlot[Labeled[#[[2]],Rotate[#[[1]],90 Degree],Top]&/@measuresList[l],PlotStyle->PointSize[Medium],PlotRange->1.2Max[l],ImageSize->{750,500}]

hGraph[l_]:=HighlightGraph[wGraph,VertexList[wGraph],VertexSize-> Thread[VertexList[wGraph]-> Rescale[l]],ImageSize->{750,500}]

hubCentrality[g_]:=HITSCentrality[g][[1]]

authCentrality[g_]:=HITSCentrality[g][[2]]

Manipulate[
h@m@wGraph,
Row[{
Control@{{h,hGraph,"show"},{hGraph->"highlighted network",measuresPlot->"scatter plot",measuresTable->"table"}},
Spacer[15],
Control@{{m,VertexDegree,"measure"},{
VertexDegree->"valence",
ClosenessCentrality->"closeness centrality",
BetweennessCentrality->"betweenness centrality",
DegreeCentrality->"degree centrality",
RadialityCentrality->"radiality centrality",
EccentricityCentrality->"eccentricity centrality",
hubCentrality->"hub centrality",
authCentrality->"authority centrality",
EigenvectorCentrality->"eigenvector centrality",
StatusCentrality->"status centrality",
PageRankCentrality->"page ranks",
LocalClusteringCoefficient->"local clustering coefficient",
MeanNeighborDegree->"mean neighbor degree"}}}],
ControlPlacement->Top, SaveDefinitions->True, Deployed->True
]

Snapshots

Description

This Demonstration plots a network encoding musical instruments used for rhythm accompaniment . The data consists of 100 recordings of 21 popular songs of Smyrna in nine - beat rhythms . You can choose various measures . The results are also presented in tables and scatter plots .

Details

The following musical instruments used for rhythm accompaniment were considered : guitar, toumperleki, spoon drums, bendir, baglamas, contrabass, oud, harpsichord, glass, zil, tambourine, lute, maracas, davul, saz, zither, bendir with zil (bendir - zil), drums, castanets, accordion, kompoloi with a glass (kompoloi - glass), synthesizer, tabla, crotalums, ney, electric guitar, and triangle, as well as the voice .

The network encodes the use of these musical instruments in the recordings, either alone or in combination . Each vertex of the network represents an instrument . If an instrument was used alone, it is connected to itself with a loop . If it was used in combination with any other instruments, it is connected to each of them with an edge . The network is weighted . The weight of each loop or edge is the frequency of use for each instrument or combination of instruments in the recordings . The surface of each highlighted vertex is proportional to its respective measure . The calculated measures are the valences, the closeness, betweenness, degree, radiality, eccentricity, hub, authority, eigenvector and status centralities, the page ranks, the local clustering coefficients and the mean neighbor degrees .

As far as we know, this Demonstration presents a novel method for studying the characteristics of musical instruments .

References

[1] C. Chatzimichail, "The Popular Songs of Smyrna in Nine Beat Rhythms Before and After the Destruction of Smyrna", Thesis, Department of Traditional Music, Technological Educational Institute of Epirus, Greece, 2017. doi:10.17605/OSF.IO/WEK3Q.

Keywords

network
graph
measure
music
popular songs of Smyrna
musical instruments
rhythm accompaniment instruments
recordings

Disclaimer of Warranties

The notebook is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or Hellenic Complex Systems Laboratory or any of its members be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the notebook or the use or other dealings in the notebook.

About

Network of Musical Instruments for Rhythm Accompaniment 
Version Number 1.2
(HyperlinkTemplate[Hellenic Complex Systems Laboratory , https://www.hcsl.com, https://www.hcsl.com, HyperlinkActionNew, HyperlinkActive, , ])2021
First published at Wolfram Demonstrations Project at: (HyperlinkURL["demonstrations.wolfram.com/NetworkOfMusicalInstrumentsForRhythmAccompaniment/", https://demonstrations.wolfram.com/NetworkOfMusicalInstrumentsForRhythmAccompaniment/])
The notebook is distributed under  an Attribution - NonCommercial - ShareAlike 4.0 International Creative Commons License.