<!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>
      <journal-title-group>
        <journal-title>DL</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>The ontocomc Ontology: A Semantic Framework for Hindemith's Harmonic System</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Thanasis Apostolopoulos</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Spyridon Kantarelis</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giorgos Stamou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Artificial Intelligence and Learning Systems Laboratory, National Technical University of Athens</institution>
          ,
          <addr-line>Heroon Polytechniou 9, Zografou, Attica, 157 80</addr-line>
          ,
          <country country="GR">Greece</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2025</year>
      </pub-date>
      <volume>38</volume>
      <fpage>3</fpage>
      <lpage>6</lpage>
      <abstract>
        <p>Ontological representation of music concepts is a growing area of research in both the data science and computational musicology communities. This paper introduces the ontocomc ontology, a scheme that focuses on note simultaneities, sequences of chords and their automated semantic annotation. Our ontology is based on Paul Hindemith's harmonic theory in his Craft of Musical Composition, an original construction completely at odds with traditional tonal harmony. A key characteristic of this scheme is its handling all conceivable simultaneities in a uniform way. This harmonic system has received very little (if any) attention in past data science research; in this sense, our approach constitutes a major novelty, leveraging the representational power of ontologies applied to Hindemith's exhaustive classification of note simultaneities. Chord sequences and their constituent parts are enriched with semantic features enabling SPARQL querying to capture and analyze distinctive stylistic patterns on the music surface. This process may provide valuable insights on the style, structure or emotional content of a music piece and can be used as part of feature engineering to machine learning applications.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;ontology engineering</kwd>
        <kwd>semantic annotation</kwd>
        <kwd>description logics</kwd>
        <kwd>SPARQL</kwd>
        <kwd>feature engineering</kwd>
        <kwd>music harmony</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>In music, the pitch is the perceptual interpretation of frequency [1]; it is associated to one of the 12
pitch classes A, A♯, B, C,..., G, G♯ and an octave (in which the pitch is located). A note (or tone) embodies
a pitch and a duration; notes heard together constitute tone simultaneities (or chords). Harmony is
concerned with the study of chords and their structure, progressions and relations. Tonal harmony
in particular considers chords in the framework of tonality, the hierarchical organization of pitches
around a tonal center (the tonic). Functional (tonal) harmony is a widely established and extensively
studied harmonic system wherein chords assume specific functions depending on their relation to
the tonic.1 Harmonic analysis represents a multi-faceted musical task involving not only identifying
chord roots and labeling chords but also segmentation into chords, defining points of key change,
identifying non-chord tones and voice leading etc. Automated harmonic analysis has been a prominent
area of research in computational musicology. For instance, [2] and [3] propose a chord model, a syntax
for chord annotation and an algorithm to compute the chord root of a note simultaneity. Pardo and
Birmingham [4] present an algorithm to segment the musical surface into chordal entities. HarmTrace
[5] performs functional harmonic analysis on a sequence of annotated chords. In the 1990s, [6] and [7]
have proposed systems for producing synthetic chorales in the style of J. S. Bach. Much more recently,
[8] and [9] have used deep learning techniques for chorale generation.</p>
      <p>The use of ontologies has been introduced in recent years to represent the music domain; a pioneer is
Music Ontology [10], encompassing a wide range of concepts. Music Note [11] and MusicNote [12] propose
a generic approach to representing, annotating, extracting, linking and searching music notation content.
Music Theory ontology [13] captures the basic network of music theoretic concepts including Note,
Interval, Chord and Progression (of notes or chords). OMRAS2 Chord ontology [14] provides a versatile
vocabulary for describing chords and chord sequences. Functional Harmony ontology [15] proposes a
thorough taxonomy of chords in the framework of functional harmony. MusicPatternOWL [16] and
Music Score ontology (MusicOWL) [17] provide a comprehensive vocabulary for annotating music
scores based on semantic information such as patterns, melodic fragments, dynamics and tonalities.</p>
      <p>Chapter 2 illustrates the basic harmonic concepts in Hindemith’s Craft of Musical Composition
(CofMC)2. Chapter 3 introduces the ontocomc ontology with its main classes, properties, rules and
extended functionality through the use of Olwready2. Chapter 4 discusses some basic queries and
limitations relating to automated chord annotating as performed via ontocomc. Chapter 5 applies
the ontology on Bach chorales annotating chords, graphically producing harmonic fluctuation and
capturing harmonic patterns. Chapter 6 concludes the paper, summarizing main points and pointing to
several directions for future research.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Hindemith’s harmony in The Craft of Musical Composition</title>
      <p>In this paper we distance ourselves from tonal harmony, following instead an alternative harmonic
theory proposed in Paul Hindemith’s The Craft of Musical Composition (1937). Hindemith considers
the interval, i.e. the distance between two pitch-classes, as his primitive building block. Intervals are
associated to interval types (major 2nd, perfect 4th, tritone etc.), which are ordered by diminishing
strength in his Series 2 (cf. Picture 7); Hindemith assigns an interval root to every interval (tritones
excepted). Chords are viewed as sets of intra-chord intervals (i.e. intervals formed between two chord
tones) and granted a chord root (or degree), namely the root of the strongest (by Series 2) of its intra-chord
intervals; in the case of chords containing some tritone, they are also assigned a guide-tone. Just as
intervals are classified according to their interval type, chords form an exhaustive chord taxonomy,
in which every chord is assigned to a specific subgroup 3 by examining the nature of its intra-chord
intervals. Dynamics in a chord sequence are governed by the fluctuation caused by the juxtaposition
of simultaneities belonging to diverse subgroups as well as the progression of corresponding chord
degrees. This is a highly original harmonic theory, at odds with any other known system, tonal or
modal.</p>
    </sec>
    <sec id="sec-3">
      <title>3. The ontocomc ontology</title>
      <p>Hindemith’s exhaustive chord taxonomy in CofMC lends itself quite naturally to a knowledge
representation scheme on note simultaneities, enriching them with features that determine their inherent
dynamics. In this paper, we propose a chord ontology called ontocomc4, described in OWL language
and developed using the Protégé 5.5.0 editor5 [21]. At the highest level, ontocomc is anchored on four
basic music objects represented with classes PitchClass, Interval, Chord and Sequence.</p>
      <p>Pitch classes , ♭ (or its enharmonic equivalent ♯), , , ♭(♯), , ♭(♯), , , ♭( ♯), ,
♭(♯) are modeled via concept PitchClass and its 12 subclasses (ontocomc.A, ontocomc.Bb etc.). Class
ontocomc:A contains individuals ontocomc:a, ontocomc:gss (for G♯♯), ontocomc:ghh6 and ontocomc:bbb (for
B♭♭), corresponding to enharmonically equivalent spellings used in common music practice; remaining
interval subclasses are populated accordingly. Pitches are represented with the Pitch concept. In this
paper, we consider pitches within the standard piano keyboard range, equivalent to MIDI numbers
21-108 (A0 to C8). Every Pitch individual gets related to (i) a PitchClass filler via object property
ontocomc:hasPitchClass and (ii) an integer in [0,8] via datatype property ontocomc:octave.
2The reader is urged to brush over a sketchy survey of CofMC in Appendix B or, better still, consult [18].
3These six subgroups are indexed with Roman numerals I-VI. Chords in Subgroups V and VI do not have a root in principle,
but may be assigned one depending on their context. In this paper, such chords are dubbed ’roving’, in a rather arbitrary
sense referring to Schoenberg in [19] and [20].
4http://purl.org/than.apos/ontocomc
5http://protege.stanford.edu
6The standard sufix for ♯ is letter s. This may be confusing to some readers, as German nomenclature normally reserves s for
♭ (for example, As denotes A♭), therefore letter h is here proposed as an alternative sufix for ♯.</p>
      <p>The ontology defines intervals (Eq. 1) and classifies them into disjoint subclasses NormIntv and
Tritone. Class UndefinedInterval is reserved for intervals with at least one note unspecified. NormIntv is
partitioned into disjoint subclasses RootLow and RootHigh and their disjoint subclasses7, as in Eq. 2:
 ≡ ∃ℎℎ. ℎ ⊓ ∃. ℎ
 ⊑   ⊔   ⊔</p>
      <p>⊑ ℎ ⊔ 
   ⊑ ∃ℎℎ. ℎ  ⊔ ∃. ℎ 
ℎ ⊑  2 ⊔  2 ⊔  6ℎ ⊔  6ℎ ⊔   4ℎ
 ⊑  3 ⊔  3 ⊔  7ℎ ⊔  7ℎ⊔</p>
      <p>⊔  5ℎ ⊔  ⊔  
 2 ⊑  2 ⊔  2 ⊔  2 ⊔ ... ⊔  2 ⊔  2
  4ℎ ⊑   4ℎ ⊔   4ℎ ⊔ ... ⊔   4ℎ</p>
      <p>... ... ... ... ...</p>
      <p>2 ≡ ∃ℎℎ. ⊓ ∃.
 2 ≡ ∃ℎℎ. ⊓ ∃.</p>
      <p>
        ... ... ... ... ...
  ≡ ∃ℎℎ. ⊓ ∃.
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
7Hindemith makes absolutely no distinction between enharmonic tones, which he considers as mere alternative spellings: in
his view for example, diminished 4th A–Db is treated in exactly the same way as major 3rd A–C♯. In this sense, the taxonomy
of intervals displayed in Eq. 2 is exhaustive.
      </p>
      <p>As an example, subclass Maj2nd of RootHigh is further partitioned into 12 sublcasses: Maj2ndA,
Maj2ndBb and so on (Eq. 3). In particular, Maj2ndA corresponds to major seconds A-B and is explicitly
defined (Eq. 4); similarly, Maj2ndBb corresponds to intervals Bb-C etc. The same rationale applies to all
other subclasses of NormIntv as well as class Tritone.</p>
      <p>At the highest level of this chord taxonomy (illustrated in Picture 1), chords are partitioned into two
disjoint subclasses: GroupA, for chords containing no tritones and GroupB, for chords containing at
least one tritone.</p>
      <p>
        SubgroupV models augmented triads, while SubgroupIII corresponds to chords with at least one
(major or minor) 2nd or 7th among their intra-chord intervals. Finally, SubgroupI is defined by means
of a closure axiom on GroupA. These definitions are displayed in (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ):
 ≡  ⊓ ∀ℎ.( 3 ⊔  6ℎ ⊔   )
 ≡  ⊓ ∃ℎ.( 2 ⊔  7ℎ ⊔  2 ⊔  7ℎ)
 ≡  ⊓ (¬( ⊔  ))
      </p>
      <p>
        GroupB chords are defined in an analogous way. In particular, SubgroupII is further partitioned into
SubgroupIIa and SubgroupIIb; the former is defined as in (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ):
 ≡ ⊓ ≤ 0ℎ. 2
      </p>
      <p>⊓ ≤ 1ℎ.  ⊓  ℎ</p>
      <sec id="sec-3-1">
        <title>Remaining chords get classified in SubgroupIIb and its subclasses.</title>
        <p>The ontocomc ontology models the chord
sequence as an independent entity; chords
get linked to it as constituent parts [22],
as shown in Figure 2. In essence, an
ontocomc:ChordSequence individual provides a
handle to the sequence object by linking
to the initial chord via object property
ontocomc:firstChord. Each chord is related
to this individual via object property
ontocomc:constituentChord. In its turn, a chord
sequence generates its corresponding sequences
of chord degrees, guide-tones and the
twovoice framework8. Figure 2: The Sequence model used in ontocomc</p>
        <p>
          Object properties ontocomc:hasNote with
functional sub-properties ontocomc:noteX (for  = 1, 2, 3, 4) refer to the four constituent pitch-classes of
a chord, while ontocomc:hasInterval with functional sub-roles ontocomc:intervalXY (for ,  = 1, 2, 3, 4
| &lt;  ) denote the six intra-chord intervals. Object properties ontocomc:low and ontocomc:high relate a
Chord instance to its two constituent PitchClass fillers. A chord is connected to all its subsequent ones in
the sequence via object property ontocomc:sequentChord. Functional sub-property ontocomc:nextChord
links the chord to the one immediately following; the last chord in line is typically ‘grounded’ by
8In CofMC, the sequence of intervals between the bass and the next most salient voice, typically the soprano.
(
          <xref ref-type="bibr" rid="ref7">7</xref>
          )
(
          <xref ref-type="bibr" rid="ref8">8</xref>
          )
(
          <xref ref-type="bibr" rid="ref9">9</xref>
          )
asseerting the triple &lt;last_chord&gt; ontocomc:nextChord ontocomc:chordNil. Role chain axiom
 : ℎ ∘  : ℎ
        </p>
        <p>: ℎ
enables reaching out iteratively to all subsequent chords in the sequence. Object properties :degree,
:frame, :guideTone, :nextDegree, :nextGuideTone, :nextFrame, :salientDissonance and
:salientDissonanceResolution pertain to chord features inferred during the chord analysis process. In particular, functional
role ontocomc:salientDissonance denotes the most prominent dissonance9 (if any) among intra-chord
intervals; object property ontocomc:salientDissonanceResolution naturally refers to its resolution in the
following chord.</p>
        <p>
          The ontology contains a set of SWRL rules, e.g. for identifying interval roots (Eq. 8):
ℎ(?), ℎℎ(?, ?) → (?, ?)
(?ℎ, ?1), 1(?ℎ, ?2), (?1, ?2) →  ℎ(?ℎ)
Eq. 9 efectively ‘pushes’ a chord already in Subgroup III and with its root in the bass further down the
taxonomy and into Subgroup III1, due to equivalence axiom (
          <xref ref-type="bibr" rid="ref10">10</xref>
          ) in the TBox:10
1 ≡  ⊓  ℎ
(
          <xref ref-type="bibr" rid="ref10">10</xref>
          )
        </p>
        <p>Although we are by now able to produce most facts pertaining to a chord sequence, identifying
degrees and guide-tones still eludes the expressivity supplied by the afore-mentioned DL axioms and
SWRL rules; in this case, a pure algorithmic approach is needed. Owlready2 is a Python module
allowing ‘ontology-oriented programming’, i.e. object-oriented programming where the entities of
an ontology may be treated as Python objects [24]. Owlready allows extending ontology classes with
Python methods, in our case notably in order to compare intervals and identify the ‘best’ among them,
using our familiar Series-2 as a yardstick (cf. Appendix C). Methods extending class Chord may be
applied in tandem to an entire chord sequence. In this way, degrees, guide-tones and salient dissonances
in a chord sequence are explicitly computed in a Python/Owlready environment and entered at the
same time as new facts in the ABox, while all remaining chord features (e.g. the frame, next degree,
next guide-tone, next frame, salient dissonance resolution) as well as each chord’s specific location in
the chord taxonomy are implicitly inferred during the process.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Use cases and limitations</title>
      <p>Tonal harmony has been thoroughly explored for well over 200 years and several systems ([5], [15]) for
automated analysis have also been proposed. The originality of our system lies in the implementation
of an alternative automated semantic annotation scheme for chords and chord sequences following
Hindemith and CofMC. The ontocomc ontology provides a univocal and unambiguous characterization
of a chord and its dynamics in a chord sequence.</p>
      <p>The core ontology signature consists of 605 non-logical axioms, 225 classes, 41 object and 13 datatype
properties. The ontology expressivity is ℒℐ(). In the following, we elaborate on some typical
queries the ontology is able to handle:
• An interval root is inferred by matching the interval against the 12 interval types, classifying it
as RootHigh or RootLow (or Tritone) and activating an SWRL rule as in Eq. 8. The interval must
ifrst be instantiated by having its low and high notes asserted in the ontology.
9The term dissonance is here borrowed from tonal harmony and denotes seconds, sevenths or tritones.
10All rules in ontocomc pertain to worlds locally closed before running the reasoner (i.e. the 4 notes of a chord, the 6 intra-chord
intervals, the constituent chords of a given sequence); these rules are thus practically DL-safe [23] and are therefore expected
to preserve decidability.</p>
      <p>• The ontology classifies a chord in its specific subgroup, by comparing intra-chord intervals
and pushing it down the chord taxonomy accordingly. The chord must first be instantiated by
asserting its 4 notes and entering 6 fresh Interval individuals to represent the intra-chord intervals;
asserting their low and high notes is inferred automatically.
• The ontology implements a full automated harmonic analysis of a chord sequence. Each chord
is annotated with its distinct features (subgroup, root and guide-tone, salient dissonance and
its resolution, chords following in the sequence etc.). The sequence can be loaded in ontocomc
(e.g. from a csv file) by enriching the ABox with assertions about notes and intra-chord intervals
for all chords and nextChord role assertions linking each chord to the next one in line. This
pre-processing step can be implemented automatedly by means of a Python/Owlready script, as
described in Chapter 5.
• Once a large repository of sequences and chords has been created, the space can be searched for
distinctive stylistic patterns satisfying specific sets of features, i.e. chord degree progressions,
cadential figures etc.</p>
      <p>At its present edition, the ontology does not support tonal center analysis. In a nutshell, Hindemith
considers the chord degree sequence as a field of interrelations governed by his Series 1; whenever
dynamics are altered, a modulation ensues. The integration of this aspect is a major topic in ongoing
research.</p>
      <p>In principle, analogies with existing ontological representations based on tonal/modal harmony (cf.
Chapter 1) are far from trivial, due to the large gap between the two worldviews. Some primitive
correspondences do exist though, for instance triads practically map to Subgroup I chords and seventh
chords generally belong to Subgroup II. More elaborate and insightful connections to existing music
ontologies should allow getting the best of both worlds.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Application to the Bach chorale corpus</title>
      <p>A chorale is a hymn of the Lutheran church, its words and melody intended to be sung by the whole
congregation. Soon after its becoming part of the church service, it grew customary to supply the
melody with a harmonic accompaniment, a practice reaching its peak with late-baroque masters. The
melody is typically entrusted to the highest voice and combined with a counterpoint in 3 additional
lines. The chorales of Johann Sebastian Bach (1685-1750) are considered perfect artifacts imbued with a
thorough understanding of the dynamics of tonality; the three lower voices shape the harmonic surface
and allow for seamless transitions between tonal regions. Bach achieves a perfect balance between the
horizontal and the vertical element through the deft and often bold use of non-chord (or nonessential)
tones, empowering individual lines with a melodic content of their own without ever compromising
tonal unity.</p>
      <p>The chord annotation and analysis procedure proposed in this paper works in two steps. At the
chord sequence generation step, a .mid music file 11 is received at the input and the information is
processed to produce 4 arrays of events, corresponding to the four voices. These horizontal sequencies
are then aligned over time to produce one single sequence of vertical chordal formations. Tokenization
of tone simultaneities is carried out at quaver note12 time resolution (the equivalent of two MIDI-file
timestamps difering by 512 time units). As onset times and token timestamps do not always coincide, a
11The entire Bach chorale corpus is uploaded at [25] in standard MIDI file format. A MIDI file is arguably the most widespread
method for symbolic music representation. It is a list of music events, notably those represented by the note-on and note-of
messages. Each such message is equipped with a MIDI note number encoding the pitch, a key velocity value for intensity, a
channel specification and a timestamp.[26]
12A quaver or eighth note is a musical note (or pause) played for one eighth the duration of a whole note (semibreve). It is
therefore a time unit relative to other rhythmic values. Its duration is half that of a crotchet (or quarter note) and twice that
of a semiquaver (or sixteenth). Quavers in Bach chorales are typically used for voice leading, while the use of semiquavers is
rather sporadic and generally reserved to ornamentation. The choice of quaver (over semiquaver) quantization keeps the
ontology reasonably uncluttered, missing little information in the process.
suitable unfolding must be performed (a similar procedure is used in [27]), wherein notes are duplicated
at every quaver (and tagged as tied, if there is no new onset at that particular metric location). Once the
chord sequence has been thus generated, the ontological space is populated with chord instances (cf.
Appendix D); this is followed by the harmonic analysis step implementing chord annotation.</p>
      <p>As an example monitoring the entire process, we introduce J. S. Bach’s chorale ‘Herzliebster Jesu’ from
the St-Matthew Passion (Figure 3)13. At first, the chord sequence of the opening phrase is generated
and tokens (chords) instantiated by having ontocomc:hasNote and ontocomc:nextChord object properties
suitably filled in. Chord names are indexed after quaver numbers, odd (even) numbers corresponding to
(non-) accentuated quavers. In other words, chords are labeled as &lt;sequence name&gt;_&lt;quaver number&gt;,
thus the first element of sequence ontocomc:herzliebster1 is labeled ontocomc:herzliebster1_7 (note the
incomplete first bar at Figure 3). Chord analysis is then carried out in Python/Owlready; results are
shown in Figure 414.</p>
      <p>With core ontology populated and enriched with chord attributes, we can graphically set out harmonic
lfuctuation; that corresponding to the first and second phrases of Herzliebster Jesu is shown in Figures 5
and 6, respectively. A conventional full-fledged harmonic analysis of the second phrase, distinguishing
non-chord tones from actual tonal harmonies15, yields the green-line curve in Figure 6; harmonic
tempo normally proceeds by crotchets, therefore contrapuntal voice-leading in quavers has largely
been suppressed16. Harmonic tempo slows further down to a minim at quaver 49: a single A7 chord
dominates the whole first half of bar 7 leading to the fermata over a D-major triad, practically brushing
of all intermediate simultaneities as mere of-springs due to voice-leading.</p>
      <p>The blue-line curve in Figure 6 illustrates a diferent approach. Here, time quantization has been
(doggedly) kept at a strict quaver, allowing us to register all time simultaneities occurring at this pace.
This is admittedly not a ‘proper’ harmonic analysis; nevertheless, it sheds light in several ways into the
workings of harmony in general and Bach’s style in particular. Rather than dismissing voice-leading,
we allow the full efect of non-chord tones to move to the forefront. Notwithstanding their transitory
nature, non-chord simultaneities induce a momentary harmonic tension in musical texture which
13downloaded from https://www.bach–chorales.com by Luke Dahn
14The reasoner needs to be called twice during execution of Python scripts: once to classify intra-chord intervals for the whole
sequence in one single batch and a second time during the derove process to classify fresh intervals between ‘roving’ chord
tones and neighboring degrees.
15In this case, the segmentation to actual harmonies has been done manually.
16The second half of bar 6 is harmonically ambiguous. The last beat (at 47-48) consists of two minor seventh chords, neither
of which would normally be expected as a self-contained entity in Bach’s times and style. The whole second half of the
bar could be treated as a single B minor triad with extended voice leading in all 4 voices. A secondary dominant on E is
nevertheless clearly implied at the very last quaver. This is an example illustrating the challenges of tonal harmony, where
the musical surface is prone to multiple conflicting analyses. Instead, Hindemith’s and our approach inherently leads to a
univocal chord annotation.
largely remains under the carpet and escapes quantification by traditional analytical procedures. Back
to our example, the first phrase of Herzliebster Jesu is largely composed in block chords (mainly triads
and dominant sevenths, corresponding to the low hills of Subgroup I/II chords in Figure 5) and produces
a rather smooth curve, notably excepting the high plateaus due to two diminished chords. The ragged
blue-line curve of the second phrase highlights a sharp contrast due to the constant injection of passing
dissonances and a longer state of high tension at quavers 46-50.
A1
Q2
A2</p>
      <p>Chord and beat value "of" and (SubgroupIII or SubgroupIV)
and inverse(nextChord) some (Chord and (SubgroupI or SubgroupII))
ℎ2_38, ℎ2_40, ℎ2_42, ℎ2_44, ℎ2_46
Chord and beat value "on" and (SubgroupIII or SubgroupIV)
and nextChord some (Chord and (SubgroupI or SubgroupII))
ℎ2_47</p>
      <p>Composers use voice-leading to shape the music surface, a procedure which causes harmonic tension
to fluctuate. The ontocomc ontology permits us to monitor the latter and, through this, acquire a tool to
analyze the former, in particular visualize and capture specific voice-leading patterns. In principle,
nonchord tones cause the formation of non-tertian chords which typically end up as members of subgroups
III and IV in our system. Non-chord tones (such as passing/alternating tones or appoggiaturas) may be
captured e.g. in the second phrase of our chorale, even by simple DL queries, as illustrated in Table
1. SPARQL queries enable a closer scrutiny on the use of non-essential notes; Table 2, for example,
displays the result of a query about progressions of 3 chords (3-grams), starting and ending on accented
beats; the middle one is a (passing) Subgroup III chord, flanked on both sides by tonal triads or seventh
chords (roughly corresponding to Subgroups I and II ). A detailed analysis on such 3-grams (starting
both on and of the beat) can be applied to the entire repository of Bach chorales, suitably stored on
GraphDB17 for example, in order to provide insights on voice-leading as a stylistic feature. An entire set
of SPARQL queries can thus be used to explore several aspects of Bach’s distinctive style.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion and future work</title>
      <p>In this paper, we have proposed a novel system implementing automated semantic annotation for
chords based on Hindemith’s Craft of Musical Composition, deploying the representational powers of
ontologies. We have introduced the ontocomc ontology and have used it as a tool to analyze a Bach
chorale, populating the ontology with chord instances and features. We have also briefly shown how
ontocomc may be used to search for distinctive chord patterns via DL and SPARQL queries.</p>
      <p>As we have seen in Chapter 5, the ontocomc ontology is a valuable tool to analyze harmonic tension,
which deserves further exploring in future research. Harmonic fluctuation and its visualization may
provide music education with a useful tool illustrating the voice-leading mechanism and could be
proposed as part of the curriculum for harmony courses. Another area of research consists in exploring
Bach’s style (e.g. see [28] and [29] for patterns to match against the entire Bach chorale corpus properly
annotated and stored in a repository). As mentioned in Chapter 4, expanding ontocomc in order to
integrate tonal center analysis is part of ongoing research, aiming at identifying the exact locations of
modulations on the musical surface. Finally, enriching chord instances with respective features can be
17https://graphdb.ontotext.com/documentation/11.0/index.html
integrated as part of learning systems towards music generation applications.</p>
    </sec>
    <sec id="sec-7">
      <title>Declaration on Generative AI</title>
      <sec id="sec-7-1">
        <title>The authors have not employed any Generative AI tools.</title>
        <p>[15] S. Kantarelis, E. Dervakos, N. Kotsani, G. Stamou, Functional Harmony Ontology: Musical</p>
        <p>Harmony Analysis with Description Logics, in: Journal of Web Semantics, 75, Elsevier, 2023.
[16] C. E. Achkar, T. Atéchian, Supporting Music Pattern Retrieval and Analysis: an Ontology-based
Approach, in: Proceedings of the 10th International Conference on Web Intelligence, Mining and
Semantics, Association for Computing Machinery, Biarritz, France, 2020.
[17] J. Jones, D. de Siqueira Braga, K. Tertuliano, T. Kauppinen, MusicOWL: the Music Score Ontology,
in: International Conference on Web Intelligence, Association for Computing Machinery, Leipzig,
Germany, 2017.
[18] P. Hindemith, Craft of Musical Composition, Book I, Associcated Music Publishers Inc., 1937.
[19] A. Schoenberg, Harmonielehre, Universal Edition, 1911/22.
[20] A. Schoenberg, Structural Functions in Harmony, Norton and Co., 1948.
[21] M. A. Musen, The Protégé project: A look back and a look forward, Association of Computing</p>
        <p>Machinery Specific Interest Group in Artificial Intelligence 1 (2015).
[22] N. Drummond, A. Rector, R. D. Stevens, G. Moulton, Putting OWL in Order: Patterns for Sequences
in OWL, in: B. C. Grau, P. Hitzler, C. Shankey, E. Wallace (Eds.), Proceedings of the OWLED*06
Workshop on OWL: Experiences and Directions, CEUR-WS, Athens, Georgia, USA, 2006.
[23] M. Krötzsch, Description Logic Rules, Ph.D. thesis, Karlsruher Institut für Technologie, 2010.
[24] J.-B. Lamy, Ontologies with Python, Programming OWL 2.0 ontologies with Python and Owlready2,</p>
        <p>Apress, 2021.
[25] L. Dahn, The four-part chorales of J. S. Bach, 2021. URL: https://kunstderfuge.com.
[26] The MIDI Association, ???? URL: https://www.midi.org/specifications-old/item/
the-midi-1-0-specification.
[27] L. Bigo, D. Conklin, Four-part Chorale Transformation by Harmonic Template Voicing, Research</p>
        <p>Report, Universidad del País Vasco (2016).
[28] C. Koechlin, Étude sur les Notes des Passage, Max Eschig, 1922.
[29] C. Koechlin, Étude sur le Choral d’ École, Eugel, 1929.
[30] H. Riemann, Harmony Simplified, the Theory of the Tonal Functions of Chords, Augener, London,
1896.
[31] W. C. Mickelsen, Hugo Riemann’s Theory of Harmony, University of Nebraska Press, 1977.
[32] E. Aldwell, C. Schachter, Harmony and Voice Leading, 3rd ed., Shirmer, 2002.
[33] Y. Sadaï, Harmony in its Systemic and Phenomenological Aspects, Yanetz, 1980.
[34] P. Hindemith, A Concentrated Course in Traditional Harmony, Associated Music Publishers, 1943.
[35] J. R. Halliday, Paul Hindemith, the Theorist, Ph.D. thesis, Eastman School of Music, 1941.
[36] P. Hindemith, A Composer’s World, Harvard University Press, 1953.</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>A. A bird’s-eye view of tonal functional harmony</title>
      <p>Tonal harmony examines the structure of chords and their relations within a tonal framework, governed
by the concept of key (or mode). A basic building block is the interval between two tones, in some sense
their distance, as determined by their frequency ratio. The smallest such interval is the second, either a
semitone or a whole tone, the latter consisting of two consecutive semitones. In general, intervals are
denoted by the number of intermediate tones: the interval A-C, for instance, is a third (referring to the
3 first notes of the familiar 7-note series A, B, C, D, E, F and G). Thirds, sixths and sevenths are further
classified as major or minor, according to the number of consecutive semitones they contain: back to
our example, A-C is a minor third (consisting of 3 semitones in total, whereas a major third would
comprise 4). Fourths and fifths are perfect (consisting of 5 and 7 semitones, respectively), augmented
or diminished. Specifically, a diminished fifth is equivalent to an augmented fourth; they comprise
6 semitones (or 3 whole tones) each and are also called tritones. Intervals may either be consonant
(minor and major thirds, perfect fourths and fifths, minor and major sixths, unisons and octaves) or
dissonant (practically all the rest, i.e. minor and major seconds, minor and major sevenths and all
diminished and augmented intervals without exception).18</p>
      <p>Generally speaking, a piece of music composed in the tonal idiom is based on a tonality, usually
a major or minor key, sometimes one of the older church modes (lydian, dorian etc.). Each such key
or mode is a distinct sequence of 7 pitch-classes (out of 12 in total) in preset distances of one or two
semitones between two consecutive ones. The first note is called the tonic or first degree, followed by
the second, the third etc., each tagged by a latin numeral (I to VII).</p>
      <p>In tonal harmony, chords are formed by stacking notes upon one another, typically at the distance of
a third, following the tertian principle. A three-tone chord or triad consists therefore of two successive
thirds, the outer tones thus lying a fifth apart. The lower note (the bass) is called the root, the other
ones are named the third and the fifth of the chord.</p>
      <p>Tonal chords are classified as
• Consonant, namely major (resp. minor) triads, in which the third lies a major (resp. minor) third
above the root and the fifth of the chord always a perfect 5th apart
• Dissonant, i.e. any remaining triads and all chords with 4 or more (distinct) tones. Such
simultaneities consist of pitch-classes perceived as somehow incompatible to each other and therefore
tend towards some sort of reparation or resolution of the dissonance.</p>
      <p>Stacking a fourth tone on top of a triad creates a seventh between the outer voices19, producing a
7thchord (inevitably a dissonant one). In case the root cedes its place at the bass to some other chord tone,
the chord is denoted as inverted. Inversions are typically used to enrich harmonic texture and allow for
a smoother voice leading and an improved bass line. Hugo Riemann (1849-1919) introduced the concept
of functional harmony in the late 19th century, describing two competing and counterbalancing
harmonic forces at play [30, 31]: the subdominant SD, mainly represented by the major chord on the
fourth degree and the dominant D, with the major chord on the fifth degree as its principal agent. The
former normally tends to the latter and this in turn to the tonic T (the major chord on the first degree):
the succession IV-V-I (SD-D-T) constitutes the perfect cadence, a harmonic schema firmly establishing
the tonality [32]. Chords on I, IV and V are called primary; auxiliary chords on the remaining degrees
typically perform one of the above functions as substitutes to primary chords.</p>
      <p>The seven pitch-classes of a mode constitute the diatonic environment. By applying chromatic
inflections to these 7 tones, one may obtain the remaining 5 pitch-classes and enrich the harmonic
18There exist diminished and augmented intervals other than 4ths and 5ths, for example the diminished third A – C aflt. These
intervals are enharmonically equivalent to some ‘simpler’ interval (A – B, in our case) and normally occur with altered
chords in tonal harmony.
19A chord sequence is typically viewed as a series of vertical simultaneities intended for a mixed chorus in 4 parts (soprano,
contralto, tenor and bass, from the top voice downwards).
texture with altered chordal formations, secondary dominants etc. A much wider choice of chords
expands tonal functions to whole regions across the musical surface. The general tendency is always
from the subdominant to the dominant, although the route may become tortuous, gradually gaining
momentum before finally landing on the tonic, in what may still be considered as a more or less extended
cadence [33]. This course may also include key changes, either transient (tonicization) or more or less
persistent (modulation). Modulations to closely-related keys (during the exposition section of a piece) or
more remote ones (in the development section) give prominence to centrifugal tendencies, at the same
time providing structure and variety to the musical surface. Transitions between keys are not always
sharp and intermediate chords may be open to multiple tonal meanings, a state that Schoenberg [19]
calls vagrant or roving harmony.20 The dynamics of tonal harmony are regulated by two complementary
forces. On the one hand, one has the vertical aspect of chords and their functions across keys and tonal
regions. On the other hand, there is the horizontal element implemented by the simultaneous voice
leading of several contrapuntal lines. This interplay between harmony and counterpoint gains impetus
by the use of neighboring and passing tones, suspensions, appoggiaturas etc. These non-chord tones
are injected on the musical surface in-between occurrences of actual (tertian) chords and are perceived
as circumstantial and irrelevant to the overall harmonic scheme. Such notes create transitional vertical
formations, typically not conforming to the tertian principle of chordal construction21. In principle,
these note simultaneities have a dissonant nature and induce tension in the texture; suspensions and
appogiaturas normally occur on accented beats and the ensuing tension is rather high, while passing
and neighboring tones usually occur of-beat and generally create a milder efect.</p>
    </sec>
    <sec id="sec-9">
      <title>B. Paul Hindemith’s Craft of Musical Composition</title>
      <p>“Our old friend Harmony, once esteemed the indispensable and unsurpassable teaching method, has had to
step down from the pedestal upon which general respect had placed her” [34]</p>
      <p>In 1937, Paul Hindemith22 published the first book (Theoretical Part) of his Craft of Musical
Composition (CofMC) [18]. Two further volumes were completed in the 40’s, dealing with the practical aspect of
writing in 2 and 3 parts. A fourth book on four-part writing was to conclude the series but was left
incomplete at the time of his death.</p>
      <p>Hindemith starts by analyzing the overtone series to explore the nature of the twelve pitch-classes.
Notes of the twelve-tone scale arise one by one through quite intricate elaborations on partials produced
by a fundamental or generator tone. The order in which these are produced reflects their relative value
in relationship to the fundamental. The first ones, namely those one fifth or one fourth away from
the generator, bear a close relationship to it; as we progress further in the sequence the relationship
grows weaker, until it becomes barely perceptible in the tone lying at the distance of a tritone. This
is Hindemith’s Series 1, ranking all 12 pitch-classes in order of their closeness to the generator tone
(Figure 7) . In efect, this series replaces the concepts of key and tonality in tonal music.</p>
      <p>Intervals enter next: Hindemith examines the simultaneous sounding of two tones, this time focusing
on the phenomenon of combination tones23. As a result, he ranks all 12 possible intervals in Series 2:
20Considering modulations in a musical piece not as mere arbitrary key changes but as a fine interplay between tonal regions
leads to a more integrated view of tonality; Schoenberg pushes this idea to the limit with his principle of monotonality:
“. . . every digression from the tonic is considered to be still within the tonality, whether directly or indirectly, closely or
remotely related. In other words, there is only one tonality in a piece, and every segment formerly considered as another
tonality is only a region, a harmonic contrast within that tonality” [20]
21Certain such formations are routinely used in idioms beyond classical music and have acquired an independent harmonic
status, e.g. suspended or major 9th chords in jazz and rock music.
22Composer, viola soloist and conductor, born in 1895 near Frankfurt, a leading figure in 20th century music. Extremely
prolific, he composed operas, symphonic music, concertos, chamber music etc. Abandoning Nazi Germany in the 30s, he
emigrated to USA and taught at Yale and elsewhere. He returned to Europe after the war, continued composing and resumed
teaching in Zurich, where he lived until his death in 1963. Apart from The Craft of Musical Composition, he has notably
written Traditional Harmony (in 2 volumes) and Elementary Training for Musicians.
23Combination tones (or diference or Tartini tones) are barely perceptible bass frequencies when two tones sound together. A
in this sequence, one moves from the (harmonically) steadier intervals of the fifth and the fourth to the
unstable seconds and sevenths, by way of thirds and sixths. Intervals come in pairs, as can be seen in
Figure 724; inverted ones immediately follow their counterparts and are therefore slightly inferior to
them. We now come to a concept of primal importance in the theory of CofMC: of the two tones, the
one best related to the combination tones (produced by the simultaneous sounding) naturally stands out;
Hindemith considers this as the fundamental and calls it the interval root. This is a wholly original
concept and does not correspond to any notion in standard tonal theory. Of each pair of intervals in
Series 2, the first has its root coinciding with the low note; its inverted counterpart has the same root,
albeit this time located high, a fact which accounts for its relative instability (Figure 8). Series 1 and 2
are Hindemith’s basic building blocks, the former providing the large connecting elements, the latter
supplying the small building material. [35] The two series look almost similar at first sight, yet they
embody two wholly diferent concepts. Series 1 assigns tonal positions to all 12 tones in relation to a
given generator (the tonal center, assumed to be pitch-class C in Figure 7). Series 2 ranks intervals in
diminishing harmonic potential while traversing the series from left to right; the melodic potential
of intervals is determined by the same series, only this time in reversed direction (Figure 8). Thus,
intervals bear an inherent amount of tension, in a sense a "load", non-decreasing as we move to the
right. The octave and the unison sound perfectly transparent at one end. The tritone holds the other
end: its potential is so high that it needs some kind of resolution. The tone closest to the root of the
resolving interval acts as the root representative of the tritone, while the other tone is called the
guide-tone.</p>
      <p>Hindemith is a harsh critic of the traditional (tonal) harmonic theory. In his view, tertian harmony
ofers a much too restrictive view of the wealth and complexity of tone simultaneities occurring in
contemporary music. In CofMC, a chord is defined as any simultaneity whatsoever, whether tertian
or other. It is the dynamics between intra-chord25 intervals which determine the nature of the chord.
Interval roots fight to exert their influence on fellow intra-chord intervals; the root corresponding to
the ‘best’ intra-chord interval (i.e. the one leftmost placed in Series 2) becomes the root (the degree) of
violinist may hear them as soft bass tones when she plays double stops perfectly in tune; organ manufacturers make use of
them in small organs to produce a low tone with two smaller pipes in place of a large one. [35]
24Images in this section are reproduced from the Greek edition of CofMC with permission from publisher Stefanos Nasos.
25We introduce here this term to denote the intervals formed between two constituent tones of a chord.
the chord (cf. Figure 9).</p>
      <p>Hindemith maintains that the nature and individual features of a chord are basically invariant to
translations of its tones across octaves, provided their order is not altered. Moreover, an inversion26
comes about not by shifting around the tones of a chord but simply by transplanting the root upward
[35]. Indeed, chords with the root at the bass tend to be more stable than formations consisting of the
same tones but with their root at a higher voice and hence are somewhat better placed in the chord
taxonomy. We have now hit at the core of CofMC’s harmonic theory: Hindemith assigns all tone
simultaneities, irrespective of their number of distinct tones or their complexity, to specific classes and
subclasses. Chords basically classify into two large groups, according to the presence (or absence) of
the tritone among intra-chord intervals. Chords with no tritones belong to Group A, while chords
containing at least one tritone belong to Group B. Chords in the latter group lack the stability of those
in the former, precisely because of the tritone gravitating towards its resolution, leading the entire
chord along. In general, chords are classified into subgroups according to the nature of their intra-chord
intervals. The two above-mentioned groups are further subdivided, Group A (Group B) into Subgroups
I, III and V (Subgroups II, IV and VI). Further subdivisions pertain to chords in root position or in
inversion. In this way, Hindemith constructs a complete hierarchy of tone simultaneities, subgroups at
the finest level partitioning the space into pairwise disjoint classes.</p>
      <p>Subgroup I consists of major and minor triads, in root position (1) or inversion
(2). Subgroup II consists of chords in which the tritone is dominated by some stronger
interval. In particular,  contains our familiar dominant seventh chords in root position.
The presence of a major second places the chord in Subgroup , further divided into subgroups 1,
2 and 3. The former two correspond to chords with one tritone, in root position and inversion
respectively; the latter subgroup consists of chords with at least two tritones. Incidentally, Subgroup
2 contains the inversions of dominant chords and similar constructions. Subgroup III, a ‘rough and
unpolished race’ in Hindemith’s colorful description, corresponds to a very large family, in essence
made up of any tone simultaneity comprising seconds or sevenths or both (and obviously no tritone). A
small subset of those may be identified as the secondary triads with added 7th and their inversions.
26Hindemith avoids the term ‘inversion’ in general. In the following, we will be using terms ‘root position’ (to indicate the
root lying in the bass) and ‘inversion’ (otherwise) for convenience, independently from their tonal homonyms.
Again, chords in root position fall under Subgroup 1, inversions under Subgroup 2. Subgroup IV,
a ‘strange set of piquant, coarse and highly colored chords’, contains tone simultaneities with minor
seconds or major sevenths or both; tritones are again subordinate to stronger intervals. This subgroup
is similarly divided into Subgroups 1 and 2. The last two subgroups are rather sparsely populated.
They consist of simultaneities with no definite direction, open to multiple interpretations. As a result, no
clear root can be assigned to them a priori, though this may change in the process, based on harmonic
context; in other words, the same chord may be provided with a diferent root, depending on the chords
surrounding it. Subgroup V is made up of Group-A chords consisting of nothing but major thirds and
minor sixths, while Subgroup VI contains Group-B chords with no other intervals but tritones, minor
thirds and major sixths27. The latter possess no intra-chord interval strong enough to dominate the
tritone, which imbues therefore the whole chord with its inherent vagueness. Referring to Group-B
chords in general, the tone which belongs to some tritone and at the same time forms the strongest
intra-chord interval with the root assumes the role of guide-tone28.</p>
      <p>Hindemith observes that the traditional (tonal) harmony is largely contained in Subgroups I, II, V
and VI; the vast space of Subgroups III and IV lies beyond the boundaries of tonal harmony. In his
view therefore, the ‘chromatic’ harmony of CofMC based on the 12-tone scale represents a considerable
extension of the traditional major/minor harmonic theory.</p>
      <p>In general, any move from lower to higher-numbered subgroups induces a decrease in tonal value,
while a step in the opposite directions causes an increase. At the same time, any such increase in
tonal value decreases harmonic tension and vice-versa. Hindemith introduces the term harmonic
lfuctuation to denote such variations in harmonic tension. Variations may be gradual or abrupt,
according to the relative tonal values of successive chords, and is visualized by means of subgroup
numerals and a sort of harmonic crescendo/decrescendo, as in Figure 10.</p>
      <p>In every chordal progression, the two leading lines are the bass and the next most important one
above it. Their combination is called the two-voice framework and determines the general direction
of harmonic activity. Intermediate lines are not relevant at this level; their purpose is to furnish each
chord with the intra-chord intervals needed to determine its precise place in the chord hierarchy, in this
way regulating harmonic fluctuation from one chord to the next. The degree progression is another
vital feature, in some sense a codification of the whole sequence 29. Indeed, a bad degree sequence
usually indicates a faulty chord progression. As expected, intervals between successive chord degrees
are governed by Series 2. Figure 10 demonstrates the three forces at play. The reader may observe
that the degree progression in this case is made up of a single repeated pitch-class (C). The two-voice
framework exhibits a peak at the fourth chord (minor seventh), followed by a release and a higher
peak at the penultimate chord (tritone). The harmonic fluctuation follows a smoother line, keeping a
steady medium tension for most of the progression before too stepping up to its highest point at the
27The latter correspond to our familiar diminished triads and diminished seventh chords, while the former correspond more
or less to augmented triads in tonal harmony.
28It is important to note that the guide-tone is not a feature of some key or mode (like the leading note in tonal theory) but an
inherent characteristic of a chord containing a tritone. This again is an original invention, without any ‘tonal’ counterpart.
29Hindemith compares the usage of chord degrees to that of logarithms in mathematics.
penultimate chord. In general, there is a constant interaction between these forces, working towards
the same direction or balancing themselves out in various ways.</p>
      <p>The degree progression is most important in setting up the ‘key’ of a musical phrase. The term key
is obviously not used here as in the major/minor schema. It rather refers to the establishment of a
fundamental tone, the ‘key’ (or tonic center), standing prominently in relief with the other tones in
the sequence arranging themselves beside it according to their place in Series 1. A loss of balance in
this sense may bring about the gradual or abrupt rise of a new fundamental tone and thus impose a
modulation. In practice, the degree progression can be used along with (or sometimes against) the
harmonic fluctuation in order to provide variety and purpose to the music texture. For instance, a
degree progression may be blurred by superposing complex chords from Subgroups III and IV, in which
case degree progression and harmonic fluctuation work along conflicting directions. Local tonic centers
may form another sequence at a higher level: a fundamental tone will emerge in the same way, this
time indicating the tonic center of a more extended excerpt, related to the tonic centers of its various
subsections.</p>
      <p>Hindemith has undoubtedly erected an original and, in many respects, even ground-breaking
harmonic theory. Naturally, his unyielding rejection of tonal harmony does sound questionable when
analyzing music obviously based on tonal precepts, despite his eforts to anticipate and nullify critics: “. . .
to musicians irretrievably engrossed in conservatism, not only will methods of composition following
our ideas appear fantastic and unartistic; it will even be denied that they are workable” [36]. On the
other hand, this theory is not restricted to some particular idiom; instead, it aspires to encompass a wide
range of genres from medieval to modern music, attempting to provide universal rational principles for
solid music making. Particularly noteworthy is Hindemith’s quantization of harmonic tension through
a taxonomy of tone simultaneities, an area virtually unexplored within the tonal framework. At any
rate, putting aside any music-theoretical reservations, our work focuses exclusively on the ontological
aspect of his chord theory.</p>
    </sec>
    <sec id="sec-10">
      <title>C. Methods to extend ontocomc classes</title>
      <p>The Python/Owlready scripts contain a number of methods to extend the functionality of
ontocomc:Interval, ontocomc:Chord and ontocomc:ChordSequence. The most important of them are displayed
below in pseudocode:
C.1. Methods extending ontocomc:Interval
def root(self ):
if self is classified as RootLow return self.low
if self is classified as RootHigh return self.high
else return ontocomc.PitchClassUndef
def series_2(self ):
series2_intvs = [Unison, Perf5th, ..., Tritone] # CofMC’s Series-2
ifnd the type of self, then return its rank in series2_intvs # values in (1,. . . ,12)
if not found return 13
C.2. Methods extending ontocomc:Chord
def notes(self):</p>
      <p>return [self.note1, self.note2, self.note3, self.note4]
def intrachord(self):
for i in range(len(self.notes()):
for j in range(i+1,len(self.notes()):</p>
      <p>create individual ontocomc.&lt;self.name&gt;_(i+1)(j+1)
run the reasoner to classify new intra-chord interval individuals
for each intra-chord interval x calculate x.series_2()
for ,  = 1, 2, 3, 4 and  &lt;  :</p>
      <p>
        self.intervalXY = &lt;self_name&gt;_XY
return interval names, Series-2 values (ordered by Series-2 values)
def find_degree(self,intrachord_dataframe):
# intrachord_dataframe is the output of self.intrachord()
# returns an integer indicating the position of the degree in the chord
if self in {SubgroupV, SubgroupVI}:
self.degree = ontocomc.PitchClassUndef
return 0
else:
drop top line/s of intrachord_dataframe with Series-2 value = 1
self.degree = x for x: root of top line interval
return position (
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4">1,2,3,4</xref>
        ) of chord degree
def find_guidetone(self,degree_position,intrachord_dataframe):
# returns an integer indicating the position of the degree in the chord
if self in {SubgroupV, SubgroupVI}:
self.guideTone = ontocomc.PitchClassUndef
return 0
else:
if self in Group A:
self.guideTone = self.degree
return chord degree position
else:
single out all tritone notes
ifnd tritone note x closest (by Series-2) to chord degree
self.guideTone = x
return position (
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4">1,2,3,4</xref>
        ) of guide-tone
def salient_dissonance(self,intrachord_dataframe):
# returns a tuple with the note positions of the most prominent dissonance
restrict intrachord_dataframe to intervals with Series-2 values in [8,12]
if self contains no dissonant intervals: return (0,0)
else:
extract index (X,Y) from bottom line of (restricted) intrachord_dataframe
self.salientDissonance = ontocomc.&lt;self_name &gt;_XY
return (X,Y)
def derove (self,neighbor):
# neighbor may be the chord preceding or following the roving harmony
# returns a tuple with the degree and guide-tone of roving chord
if neighbor.degree == ontocomc.pitchClassUndef: return (0,0)
else:
create fresh intervals between each of self.notes() and neighbor.degree
run the reasoner to classify new intervals, compute their Series-2 values
select interval x with min Series-2 value
. = .ℎℎ
return (y,0), where y: position of self.degree in the chord
C.3. Methods extending ontocomc:ChordSequence
def seq_features(self):
# updates the ontology with chord features, i.e. degrees, guide-tones etc.
# applies rationale of ontocomc.Chord methods for all chords in one batch
      </p>
    </sec>
    <sec id="sec-11">
      <title>D. The chord sequence generation procedure</title>
      <p>The chord sequence generation pre-processing step (cf. Chapter 5) is displayed below in pseudocode.
The procedure receives a Bach chorale excerpt in MIDI music file format and generates 4 sequences of
pitch-classes, representing the four voices, unfolded at quaver quantization:</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Anglade</surname>
          </string-name>
          ,
          <article-title>Logic-based Modelling of Musical Harmony for Automatic Characterisation and Classification</article-title>
          ,
          <source>Ph.D. thesis</source>
          , School of Electronic Engineering and Computer Science, Queen Mary, University of London,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>C.</given-names>
            <surname>Harte</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sandler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Abdallah</surname>
          </string-name>
          , E. Gómez,
          <article-title>Symbolic representation of musical chords: a proposed syntax for text annotation</article-title>
          ,
          <source>16th International Conference on Music Information Retrieval</source>
          ,
          <source>Proceedings (ISMIR</source>
          ,
          <year>2005</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>E.</given-names>
            <surname>Cambouropoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kaliakatsos-Papakostas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Tsougras</surname>
          </string-name>
          ,
          <article-title>An Idiom-independent Representation of Chords for Computational Music Analysis and Generation, Joint 40th International Computer Music Conference (ICMC) and 11th Sound and Music Computing (SMC) Conference (</article-title>
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>B.</given-names>
            <surname>Pardo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W. P.</given-names>
            <surname>Birmingham</surname>
          </string-name>
          ,
          <source>The Chordal Analysis of Tonal Music</source>
          ,
          <source>Technical Report</source>
          , Electrical Engineering and Computer Science Department, University of Michigan,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>W. B. de Haas</surname>
            ,
            <given-names>J. P.</given-names>
          </string-name>
          <string-name>
            <surname>Magalhães</surname>
            ,
            <given-names>R. C.</given-names>
          </string-name>
          <string-name>
            <surname>Veltkamp</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Wiering</surname>
          </string-name>
          ,
          <article-title>HarmTrace: Improving Harmonic Similarity Estimation Using Functional Harmony Analysis, 12th International Society for Music Information Retrieval (ISMIR) Conference (</article-title>
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>K.</given-names>
            <surname>Ebcioğlu</surname>
          </string-name>
          ,
          <article-title>An Expert System for Harmonizing Chorales in the Style of</article-title>
          J. S. Bach,
          <source>The Journal of Logic Programming</source>
          ,
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          (
          <year>1990</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>H.</given-names>
            <surname>Hild</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Feulner</surname>
          </string-name>
          , W. Menzel,
          <article-title>Harmonet: A Neural Net for Harmonizing Chorales in the Style of J. S. Bach</article-title>
          , in: J. E. Moody, S. J.
          <string-name>
            <surname>Hanson</surname>
          </string-name>
          , R. P. Lippmann (Eds.),
          <source>Proceedings of the 5th International Conference on Neural Information Processing Systems (NIPS)</source>
          , Morgan Kaufmann Publishers Inc.,
          <year>1991</year>
          , pp.
          <fpage>267</fpage>
          -
          <lpage>274</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>G.</given-names>
            <surname>Hadjeres</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Pachet</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Nielsen</surname>
          </string-name>
          ,
          <article-title>DeepBach: a Steerable Model for Bach Chorales Generation</article-title>
          , in: D.
          <string-name>
            <surname>Precup</surname>
            ,
            <given-names>Y. W.</given-names>
          </string-name>
          <string-name>
            <surname>Teh</surname>
          </string-name>
          (Eds.),
          <source>Proceedings of the 34th International Conference on Machine Learning</source>
          ,
          <volume>70</volume>
          , JMLR, Sidney, Australia,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>F.</given-names>
            <surname>Liang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gotham</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Johnson</surname>
          </string-name>
          ,
          <article-title>Automatic Stylistic Composition of Bach Chorales with Deep LSTM</article-title>
          , in: S. J.
          <string-name>
            <surname>Cunningham</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <string-name>
            <surname>Duan</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          <string-name>
            <surname>Hu</surname>
          </string-name>
          , D. Turnbull (Eds.),
          <source>Proceedings of the 18th International Society for Music Information Retrieval Conference</source>
          , ISMIR, Suzhou, China,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Raimond</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Abdallah</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sandler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Giasson</surname>
          </string-name>
          , The Music Ontology,
          <source>in: Proceedings of the 8th International Conference on Music Information Retrieval</source>
          ,
          <string-name>
            <surname>ISMIR</surname>
          </string-name>
          , Vienna, Austria,
          <year>2007</year>
          , pp.
          <fpage>417</fpage>
          -
          <lpage>422</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>A.</given-names>
            <surname>Poltronieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gangemi</surname>
          </string-name>
          , The Music Note Ontology, in: K. Hammar,
          <string-name>
            <given-names>C.</given-names>
            <surname>Shimizu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. K.</given-names>
            <surname>McGinty</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Asprino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. A.</given-names>
            <surname>Carriero</surname>
          </string-name>
          (Eds.),
          <source>Proceedings of the 12th Workshop on Ontology Design and Patterns (WOP</source>
          <year>2021</year>
          ), CEUR-WS,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>S. S.</given-names>
            <surname>Cherfi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Guillotel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Hamdi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Rigaux</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Travers</surname>
          </string-name>
          ,
          <article-title>Ontology-based Annotation of Music Scores, in: The Knowledge Capture Conference, Association for Computing Machinery</article-title>
          , Austin, Texas, USA,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Rachid</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. D.</given-names>
            <surname>Roure</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. L.</given-names>
            <surname>McGuinness</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A Music</given-names>
            <surname>Theory</surname>
          </string-name>
          <string-name>
            <surname>Ontology</surname>
          </string-name>
          ,
          <source>in: Proceedings of the 1st International Workshop on Semantic Applications for Audio and Music</source>
          , Association for Computing Machinery, Monterey, California, USA,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>C.</given-names>
            <surname>Sutton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Raimond</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mauch</surname>
          </string-name>
          ,
          <source>The OMRAS2 Chord Ontology</source>
          ,
          <year>2007</year>
          . URL: http://purl.org/ ontology/chord.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>