<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Music Score Analysis with Process Mining (Extended Abstract)</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>István Koren</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Chair of Process and Data Science, RWTH Aachen University</institution>
          ,
          <addr-line>Aachen</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>123</fpage>
      <lpage>127</lpage>
      <abstract>
        <p>Process mining is applied to a wide variety of use cases, most typically for processes like order-tocash and purchase-to-pay. Respective algorithms are able to discover bottlenecks, identify recurring patterns and deal with concept drifts. So far, use cases in cultural heritage scenarios are scarce. Music scores provide an ideal opportunity for process mining algorithms; they are structured into notes, measures, repetitions, parts, instruments, etc. In addition, there are compelling characteristics, like varying dynamics, transformations through modulations, and phase delays as in a fugue. In this demo article, we present a tool that is able to do a process-style analysis of music scores. Most notably, it transforms scores into an event log and performs basic process discovery. We see potential not only for music theorists but also as a pedagogical tool to illustrate process mining concepts and as a means to produce event logs for advancing process mining algorithms and visualizations.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Process Mining</kwd>
        <kwd>Music Analysis</kwd>
        <kwd>Cultural Heritage</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Process mining is used in a wide variety of use cases for all kinds of industrial and societal
processes [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Event logs are at the baseline; they contain sequences of events that describe
the execution of a process. Taking event logs as starting point, process mining can be used to
automatically discover, monitor, and improve processes. For example, it can discover how a
process is actually being executed, find bottlenecks, or identify improvement opportunities.
Process mining is a relatively new field, yet it is a valuable tool for any organization that wants
to improve its business processes.
      </p>
      <p>
        Use cases in the field of cultural heritage are rare so far. For instance, process mining
techniques have been compared to the methodological tool chaîne opératoire common in
archaeology [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. We have not found any applications of process mining in music, despite the
obvious parallels: Music pieces are usually denoted in a strongly formalized notation called
scores. Especially in orchestral pieces, there is a lot of concurrency of instruments; throughout
history, there have been a number of genres with similar patterns like repetitions and variations.
We postulate the following research question: Can music scores be processed so that existing
process mining tools can be used to analyze musical pieces?
      </p>
      <p>In this demo paper, we present a proof-of-concept tool that is able to transform musical scores
in the popular MusicXML notation to event logs. This enables new interpretations of musical art,
for instance, by analyzing rhythm and repetitions in a process-oriented visualization. Specifically,
we encode a piano piece of a recent number one hit single as event log. The visualized results are
surprisingly clear. Therefore, we are optimistic that this type of analysis can help advance not
only music theory but also process mining by making the large body of music scores available
as event logs. Our tool can also be used as a pedagogical instrument to vividly explain business
process management concepts.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Parallels to Process Analytics</title>
      <p>
        Regarding music and data mining, there are not many related work applying standard data
mining methods to music; a notable exception is the book Music Data Mining [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Baratè et
al. present a musicological analysis with Petri nets as formal tools for studying concurrent,
asynchronous, and parallel processes [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. They focus on extracting groups from music scores as
objects, such as episodes, themes, and rhythmic patterns, to visualize them as transition system.
Musical set theory as a subdiscipline of music theory similarly organizes musical objects and
describes their relationships to discover deep structures (e.g., [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]).
      </p>
      <p>Especially in orchestral pieces, there is a lot of concurrency by instruments played
simultaneously; throughout history, there have been many genres with similar patterns, like repetitions
and variations. We postulate the following research question: Can music scores be processed so
that existing process mining tools can be used to analyze musical pieces?</p>
      <sec id="sec-2-1">
        <title>Chord: Group of multiples notes played together; stands for activity variants.</title>
        <p>Dynamics: The volume of (a sequence of) notes; could represent the amount of resources
consumed.</p>
        <p>Modulation: Refers to a key change, if a melody is replayed on a diferent base note;
corresponds to concept drifts.</p>
        <p>Note: Basic unit of a score, besides pauses; can be considered the most fine-grained activity.
Repetition: Looped parts, often explicitly denoted variations; stands for re-executions.
Rhythm: A sequence of beats forming recognizable patterns; could represent the timing of
events.</p>
      </sec>
      <sec id="sec-2-2">
        <title>Tempo: How fast the piece is played, corresponds to the execution speed.</title>
        <p>Typically, these features are combined in infinite possible variations. Throughout history,
particular styles have formed, such as the fugue, where a musical theme is repeated in various
pitches and through diferent instruments. It is trivial to see further parallels to process mining
techniques such as frequent pattern mining and local process models.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Mining Approach and Example</title>
      <p>Our general approach is as follows. First, we parse a digital music score file. Currently, the entire
piece of music is considered as one case. In a preprocessing step, we either select a single part
(e.g., the left or right hand in a piano piece or a specific instrument in a classic orchestra piece)
or merge all notes played in parallel. We then step through the score, following repetitions, and
create one activity per unique measure, c.f. Figure 1. As the activity notion, we serialize the
measure and reuse existing activities if the same musical pattern has already been discovered.
Based on the annotated tempo, we calculate a timestamp for each measure.</p>
      <p>
        Our implementation is based on a Python script using the music21 [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and PM4Py [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] libraries.
The library can parse a number of digital music score formats, including the popular MusicXML,
an XML-based data format. We map the input of the measures as PM4Py Event objects. PM4Py
is then used to export the log as XES file and display the resulting process model.
      </p>
      <p>As an example piece, we chose a relatively simple piano arrangement of the worldwide
number-one hit “As It Was” by Harry Styles as a MusicXML file. It is a suitable example,
as the characteristic sequence shown in Figure 1 fits in one measure and is repeated several
times. The resulting process model is shown in Figure 2 as a directly-follows graph (DFG). It
is very easy to see that the melody known from Figure 1 (where the left hand has a break)
forms the first and the last measure of the song. In addition, several repetitive patterns can
be recognized, including a large one, as well as the repeated succession of the characteristic
sequence {5, 6, 7, 8}. On the web frontend, the activities in the process model can be
clicked to replay the corresponding notes as audio.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Discussion and Outlook</title>
      <p>In this paper, we positioned process mining as a technique to analyze music. This is possible
since music scores share many characteristics with business processes. As a proof-of-concept,
we presented a tool that transforms musical notation into event logs so that hundreds of process
mining techniques can be applied directly. Therefore, we can answer the research question
from Section 1; it is possible to repurpose process mining tools for music scores by performing
a number of preprocessing steps. In the demo, we analyzed the 2022 hit “As It Was” by Harry
Styles by transforming a piano arrangement as an event log and creating a DFG.</p>
      <p>The current algorithm that turns music scores into process models follows a very simple
scheme by taking measures as input and assigning them labels sequentially. As a next step,
we plan to realize diferent activity notions beyond measures, such as complete melodies, and
thereby validate event abstraction techniques. Similarly, we experiment with our case notion to
infer the process behavior of entire musical epochs possibly. With object-centric event logs, we
could model the concurrent interplay of multiple instruments and the resolution of measures to
notes. We plan to discuss our tool with music theorists to evaluate its applicability. It could
give a new perspective for analyzing extensive music collections, e.g., the whole Köchel catalog,
a collection of compositions by Wolfgang Amadeus Mozart. The current approach focuses
on the modern Western notation of music, neglecting other notation systems of the world.
Similar formal notations exist for dance notation that could be similarly incorporated into our
framework.</p>
      <p>Process models as preprocessed scores could also serve as intermediary inputs to machine
learning algorithms that output creative compositions or be used to explain them. Also, measure
embeddings could be used instead of simple look-up tables, similar to word2vec. Given the
large body of available music scores, our tool could help advance process mining techniques by
providing countless (acoustically replayable and explainable) examples for training or be used
in teaching to illustrate BPM concepts. Likewise, acoustically playable process models could
facilitate the accessibility of process mining tools for visually impaired people.</p>
      <p>Besides music scores, our approach is transferable to streaming settings by capturing live
music. This would make the parallels to techniques such as conformance checking even more
apparent, as slight variations like length and hitting a wrong note are recognizable as deviations.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          , J. Carmona (Eds.),
          <source>Process Mining Handbook</source>
          , Springer, Cham,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Brysbaert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bocchi</surname>
          </string-name>
          , E. Tuosto,
          <article-title>Relating archaeological chaîne opératoire and process mining in computer science</article-title>
          ,
          <source>Archeologia e Calcolatori</source>
          <volume>23</volume>
          (
          <year>2012</year>
          )
          <fpage>165</fpage>
          -
          <lpage>186</lpage>
          . Publisher: Edizioni
          <string-name>
            <surname>All'Insegna del Giglio</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>T.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ogihara</surname>
          </string-name>
          , G. Tzanetakis, Music Data Mining, CRC Press, Boca Raton,
          <year>2012</year>
          . OCLC:
          <volume>756680089</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>Baratè</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Haus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. A.</given-names>
            <surname>Ludovico</surname>
          </string-name>
          ,
          <article-title>Music Analysis and Modeling Through Petri Nets</article-title>
          , in: R.
          <string-name>
            <surname>Kronland-Martinet</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Voinier</surname>
          </string-name>
          , S. Ystad (Eds.),
          <source>Computer Music Modeling and Retrieval</source>
          , volume
          <volume>3902</volume>
          , Springer Berlin Heidelberg, Berlin, Heidelberg,
          <year>2006</year>
          , pp.
          <fpage>201</fpage>
          -
          <lpage>218</lpage>
          . URL: http://link.springer.com/10.1007/11751069_19. doi:
          <volume>10</volume>
          .1007/11751069_19, series Title: Lecture Notes in Computer Science.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.</given-names>
            <surname>Schuijer</surname>
          </string-name>
          ,
          <article-title>Analyzing atonal music: pitch-class set theory and its contexts, Eastman studies in music</article-title>
          , University of Rochester Press, Rochester, NY,
          <year>2008</year>
          . OCLC:
          <volume>213307961</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M. S.</given-names>
            <surname>Cuthbert</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          <article-title>Ariza, music21: A Toolkit for Computer-Aided Musicology and Symbolic Music Data (</article-title>
          <year>2010</year>
          ). Publisher: International Society for Music Information Retrieval.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Berti</surname>
          </string-name>
          ,
          <string-name>
            <surname>S. J. van Zelst</surname>
          </string-name>
          ,
          <string-name>
            <surname>W. van der Aalst</surname>
          </string-name>
          ,
          <article-title>Process Mining for Python (PM4Py): Bridging the Gap Between Process-</article-title>
          and
          <string-name>
            <surname>Data Science</surname>
          </string-name>
          ,
          <source>in: Proceedings of the ICPM Demo Track 2019 co-located with 1st International Conference on Process Mining (ICPM</source>
          <year>2019</year>
          ), volume
          <volume>2374</volume>
          ,
          <string-name>
            <surname>CEUR-WS</surname>
          </string-name>
          , Aachen, Germany,
          <year>2019</year>
          . URL: https://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>2374</volume>
          /paper4.pdf.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>