<!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>OMDN at the MediaEval 2015 C@merata Task</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Donncha S. Ó Maidín</string-name>
          <email>Donncha.OMaidin@ul.ie</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of CSIS University of Limerick Limerick</institution>
          ,
          <country country="IE">Ireland</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2015</year>
      </pub-date>
      <fpage>14</fpage>
      <lpage>15</lpage>
      <abstract>
        <p>The task is concerned with using a natural language query and a file containing an encoding of a music score to produce a list of locations in the score that match the query. This task is achieved by (1) parsing the input query string using string processing, (2) formation of matching templates and (3) performing the search on the score and (4) reporting results in specified format. Searches on the score are performed using CPNView [2,3,4], a score container-iterator representation is generated from MusicXML code.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1.2 Element Core</title>
      <p>The core forms the unqualified part of the query element that
identifies some basic feature of a note or rest, such as pitch, pitch
class and duration, either singly or in combination.</p>
      <sec id="sec-1-1">
        <title>Type</title>
        <p>pitch class (note)</p>
        <p>Pitch (note)
pitch class and duration
(note)
pitch and duration (note)
Duration (note)</p>
        <p>Rest</p>
      </sec>
      <sec id="sec-1-2">
        <title>Examples</title>
        <p>A, Bb, C sharp</p>
        <p>A3, Bb4, C4 sharp
A crotchet, eighth note A, A
eighth note
A#4 crotchet, crotchet A4
sharp.</p>
        <p>sixteenth note, quaver
sixteenth note rest, quaver
rest</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>1.3 Element Pre-Qualifiers</title>
      <p>Element pre-qualifiers precede the Element Core. They serve
a number of functions. These include the specification of
repetition such as ‘melody lasting 8 ....’; ‘ melody of seven ...’.</p>
      <p>Also the pre-qualifier is used to specify an attribute of an
element, either on its own or together with a repetition specifier:
trill on a quaver A. [attribute + ' on a ' + core element]
slurred .. [ adjectival attribute + core element]
ten staccato …[ repetition + attribute + core element]</p>
    </sec>
    <sec id="sec-3">
      <title>1.4 Element Post-Qualifiers</title>
      <p>Post-qualifiers are used to limit the search to elements with a
specific instrument or clef, time signature, articulation, or
location: in the Violins 2, in the treble clef, in bars 22-32, in the
right hand, in 3/4 time, on the word “...”</p>
    </sec>
    <sec id="sec-4">
      <title>1.5 CPNView</title>
      <p>Common Practice Notation View, or CPNView is used to
answer a subset of the questions in the C@merata challenge [1].
CPNView formed the main topic of a PhD dissertation [2]. The
name CPNView was not used in the dissertation, but appeared in
in later publications [3][4][5].</p>
      <p>The meaning of symbols in a score depends on their
preceding context. The emphasis a performer places on a note, for
example is influenced by its position in the bar and by the time
signature. Such contexts may be modified by an attached symbol
such as marcato placed on an otherwise unstressed note.
Contextual mechanism is employed in pitch representation in
which key signature, clef and accidental alterations play a part. In
CPNView, the user is freed from the need to keep track of such
scoping concerns, as contexts are made available automatically by
the iterator class.</p>
      <p>CPNView models a score as an objected-oriented container.
The CPNView model is designed to provide a value-neutral and
objective representation of a score from common-practice
notation. The score's internal content is available using iterators.
The iterators and their member functions can be viewed as
paralleling the actions of a human reader. A score object is created
by specifying a file path:</p>
      <sec id="sec-4-1">
        <title>Score score(path);</title>
        <p>This model requires no user knowledge of how the score is
represented in a file. CPNView representation is built from a
software component that imports from files in a number of
different standard encodings.</p>
        <p>Access to the internals of the score is facilitated by an
iterator object:</p>
      </sec>
      <sec id="sec-4-2">
        <title>ScoreIterator cursor(score);</title>
        <p>or ScoreIterator cursor(score, 1);</p>
        <p>The first instance creates an iterator that initially points to the
start and is used to visit all of the objects in a score in time order.
Where the score contains multiple staves, this is an appropriate
iterator for harmonic analysis. The second form, with an
additional parameter 1 in this case is used to iterate a single stave.</p>
        <p>In either case the iterator can be made to step through all of
the objects in the score using the step member function. The step
function returns a value true as long as a succeeding object exists.
The following code skeleton makes all objects available, in
sequence to any code that replaces the ellipsis.</p>
        <p>while ( cursor.step()) {...}</p>
        <p>If it is required to visit only the notes in the score, a
parameter may be given to the step function as in the following
code to count the notes in a score.</p>
        <p>long count = 0;
while ( cursor.step(NOTE)) {count++;.}</p>
        <p>A locate member may be used to place the score iterator in
an arbitrary position. For example the iterator may be positioned
at the start of bar 20 by means of
cursor.locate(BAR, 200);</p>
        <p>The ScoreIterator object has a comprehensive range of
member functions to retrieve all of the information that is
contained within the score.</p>
        <p>
          A natural language query that searches for all of the D notes
and prints details of each note arrived at is achieved by
while ( cursor.step(NOTE))
if ( cursor.getAlpha() == 'D' )
cout &lt;&lt; cursor &lt;&lt; “\n”; (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )
        </p>
        <p>In addition to modeling a score, CPNView has a set of
components that facilitate processing musical information. They
include container/iterator classes for Lists, Sets and Stores.</p>
        <p>A specialised class exist for calculating pitch class sets. The
pitch class object is based on a modified version of the
classification system of Alan Forte [6]; see also [2].</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>2. APPROACH</title>
    </sec>
    <sec id="sec-6">
      <title>2.1 Parsing the Input String</title>
      <p>A string, S(n) with n elements separated by n-1 operators is
processed as follows. A list consisting of search template records
is formed where each string element generates a corresponding
search record, in sequence.</p>
      <sec id="sec-6-1">
        <title>Step</title>
        <p>1
2</p>
      </sec>
      <sec id="sec-6-2">
        <title>Form</title>
        <p>
          S(
          <xref ref-type="bibr" rid="ref1">1</xref>
          )
S(n)
        </p>
      </sec>
      <sec id="sec-6-3">
        <title>Action</title>
        <p>
          Parse, create a search template record, and
add the template record to the template list,
exit and perform search
Structure the string as [ S(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) + operator +
S(n-1) ], process S(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) to create a template
list record as in step (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) and recursively
apply step (
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) to S(n-1) until exit from step
(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ).
        </p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>2.2 Search Template</title>
      <p>The template is a C++ record consisting of native C++ types,
and various convenient types from CPNView, as well as a
comparisonType that is used to select the type of search. The
comparisonType value is created from an analysis of the core of
the search string element. The part of the template used for
matching note and rest core elements contains identifiers for the
comparison type, for pitch, duration and attribute details.</p>
      <p>Search details from the pre- and post element qualifiers are
encoded in additional fields of the search template. These include
the use of a CPN Set class for storing attributes of notes, search
range, and various fields that arise in a search including
instrument, tempo, clef, word, and others.</p>
    </sec>
    <sec id="sec-8">
      <title>2.3 The Search</title>
      <p>The task of matching sequence of notes and rests involves
matching members of the template list and exhaustively searching
the score for sequences of notes and rests that match the list of
templates.</p>
      <p>For each stave</p>
      <p>A: set n = 1
B: set m = 1</p>
      <p>set nn = n
C: visit element nn on stave and</p>
      <p>check for match with template list record m
if element does not match template list record go to D:
if template list at end record a match and go to D:
else increment nn and m and go to C:
D: if more elements in stave, increment n and go to B:
else if all staves processed exit
else move to next stave</p>
    </sec>
    <sec id="sec-9">
      <title>3. RESULTS AND DISCUSSION</title>
      <p>Although the implementation of pre- and post-qualifiers and
of inter-element operators had previously produced valid results,
these had to be disregarded at the time of submission due to
malfunction in the CPNView/MusicXML component that was
under development. Previously functioning harmonic analysis had
to be abandoned for similar reasons.</p>
      <sec id="sec-9-1">
        <title>Number of</title>
        <p>searches
performed
36</p>
      </sec>
      <sec id="sec-9-2">
        <title>Number of matches</title>
        <p>87</p>
      </sec>
      <sec id="sec-9-3">
        <title>Invalid results from misnumbered bars</title>
        <p>Mozart's An Chloe
&amp; Horn Duo</p>
      </sec>
      <sec id="sec-9-4">
        <title>Disputed results</title>
        <p>Nos. 23
32 42</p>
      </sec>
    </sec>
    <sec id="sec-10">
      <title>4. CONCLUSION</title>
    </sec>
    <sec id="sec-11">
      <title>4.1 Observation</title>
      <p>With the exception of the two invalid sets of results other
case achieved scores of 1.0 in beat precision, beat recall, measure
precision and measure recall. Other cases arose from either
incompatible bar numbering or from case where the results are
disputed.</p>
    </sec>
    <sec id="sec-12">
      <title>4.2 Recommendations for a Line of</title>
    </sec>
    <sec id="sec-13">
      <title>Questioning</title>
      <p>The rules of either strict or free counterpoint are well
documented. These might provide a material for constructing
future questions. In a future iteration of C@merata, some
questions relating species counterpoint might be considered,
starting with first species counterpoint. Success in this endeavour,
especially if the five counterpoint species are eventually explored
might lead to the development of useful tools for composition
students.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Sutcliffe</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , Fox.,
          <string-name>
            <surname>C</surname>
          </string-name>
          , Hovy,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Root</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.L.</given-names>
            ,
            <surname>Lewis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. Task</given-names>
            <surname>Description</surname>
          </string-name>
          v2
          <string-name>
            <surname>C</surname>
          </string-name>
          @
          <article-title>MERATA 15: Question Answering on Classical Music Scores</article-title>
          . On http://csee.essex.ac.uk/camerata
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Ó</given-names>
            <surname>Maidin</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.S.</surname>
          </string-name>
          <year>1995</year>
          .
          <article-title>A Programmer's Environment for Music Analysis</article-title>
          .
          <source>PhD Thesis</source>
          , University College Cork,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Ó</given-names>
            <surname>Maidin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.S.</given-names>
            and
            <surname>Cahill</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <year>2001</year>
          .
          <article-title>Score Processing for MIR</article-title>
          .
          <source>In Proceedings of the International Society for Music Information Retrieval</source>
          , Bloomington,
          <year>Indiana 2001</year>
          , pp.
          <fpage>59</fpage>
          -
          <lpage>64</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Ó</given-names>
            <surname>Maidin</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.S.</surname>
          </string-name>
          <year>1998</year>
          .
          <article-title>A Geometrical Algorithm for Melodic Difference</article-title>
          .
          <source>In Computing and Musicology II. Melodic Similarity. Concepts</source>
          ,
          <string-name>
            <surname>Procedures</surname>
            , and Applications, ed Walter B. Hewlett and
            <given-names>Eleanor</given-names>
          </string-name>
          <string-name>
            <surname>Selfridge-Field</surname>
          </string-name>
          (Cambridge Massachusetts and London, The MIT Press,
          <year>1998</year>
          ), pp.
          <fpage>65</fpage>
          -
          <lpage>72</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Forte</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>1973</year>
          .
          <article-title>The Structure of Atonal Music. (New Haven</article-title>
          and London: Yale University Press,
          <year>1973</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>