Formalized Reasoning for Symbolic Music Representations
The history of symbolic music computing stretches back to the earliest AI-music experiments. Although interest in this area waned for several decades, recent efforts to build standard music representations for the internet—particularly MusicXML and IEEE P1599—have given it new momentum. A knowledge base that reasons at the same level of abstraction as a human musician offers clear, traceable logic, which is especially valuable for knowledge maintenance and reuse.
This article presents formalized symbolic reasoning for interval spelling and chord spelling, with an implementation using the Z notation. Unambiguous definitions for both interval and chord names are demonstrated.
To fully benefit from centuries of music-theoretical development, computer scientists should embed the same musical categories into their inference engines. Running inferences at the granularity of music theory is known as symbolic computing—a concept that dominated artificial intelligence through the 1970s.
Claude Palisca observed that music theory describes the structure of music through melody, rhythm, counterpoint, harmony and form, at a foundational level involving pitches, intervals and tonal systems. How should these properties be encoded into a computer?
Music computing spans sound synthesis, editing tools and analysis engines. Most current systems use pitch and time as the smallest units of representation, commonly employing MIDI note numbers—for example, C4 becomes 60. While convenient because MIDI is broadly supported, its design as a communication protocol for digital instruments makes it unsuitable for many reasoning tasks.
Representing pitch as a MIDI number introduces ambiguity: should note 63 be read as D♯4 or E♭4? The following sections examine how interval and chord spelling can be computed symbolically. Although these operations seem elementary to trained musicians, if music theory is to drive computer inference, the representation must share the same vocabulary analysts use. Consider the intervals C4–E♭4 and C4–D♯; these should be spelled as minor third and augmented second, respectively. Although E♭ and D♯ produce the same pitch on a keyboard, in music theory they are not the same note. A reasoning system must distinguish them, whereas most implementations cannot because both pairs are merely three semitones apart.
Literature Review
Formalizing music representation requires balancing two concerns: how expressively the representation captures musical properties, and how efficiently those properties can be used to generate new knowledge. No single representation works for every application—the best choice depends on the task. Research has generally followed either symbolic or sub-symbolic approaches; the focus here is on symbolic methods.
Symbolic Music Representation
The Musical Instrument Digital Interface (MIDI) remains one of the most successful symbolic representations, operating at the level of instrument, pitch, time, and a few performance instructions such as dynamics and pitch bend. MIDI does not allow higher-level groupings like melody lines or chords. This is not a flaw but a deliberate design decision.
In the 1980s, researchers explored many representation schemes, leading to tools for input/output (DARMS, Common Music, MUSTRAN, SCORE, MusixTex), sound synthesis (Max Mathews' Music N family, GROOVE, Buxton's SSSP and automatic composition (MUSICOMP, Koenig's Project I and Project II, Barry Truax's POD).
Commercial packages have also pushed symbolic music forward. Cakewalk Sonar, Cubase, Finale and Sibelius share data mainly through standard MIDI, and the rise of the internet spurred unified XML-based formats: MusicXML and the IEEE P1599 standard.
Basic Operations
Researchers have defined fundamental operations for symbolic computation. Add(X, Y) and sub(X, Y), for example, handle pitch and interval, or time values:
- Degrees: {ˆ1, ˆ2, ˆ3, ˆ4, ˆ5, ˆ6, ˆ7}
- Accidentals: {♮, ♯, ♭, ×, ♭♭}
- Octaves: 1…8
- Pitch: separated into Degree × Accidental × Octave
Time-related operations include add(dd) on durations, add(td) adding a duration to a time value, sub(tt) and sub(dd) subtraction equivalents. Pitch comparison operations check equality, greater-than and lesser-than—essential for determining whether, for example, C4 is higher than C3. Pitch subtraction (subpp) and pitch add (addpi) also appear in the literature.
Interval spelling and transposition are the foundation for constructing scales and chords, yet leaving the interval as a simple natural number obscures the spelling. The formal specification below resolves that ambiguity.
Formal Specifications
The symbols used in this discussion are:
- Pitch symbols: Middle C on a full-sized keyboard is C4. One octave higher is C5, and lower is C3. Accidentals sit in front of the octave number, as in C♯4 and D♭4.
- Scale degrees: A major-scale pitch is shown as ˆ1, ˆ2, ˆ3, ˆ4, ˆ5, ˆ6, ˆ7. Minor scales are relative to their major; thus the harmonic minor yields ˆ1, ˆ2, ♭ˆ3, ˆ4, ˆ5, ♭ˆ6, ˆ7.
Interval Spellings
The approach used follows conventional classical naming (perfect fifth, minor seventh) but could be adapted to jazz or popular styles. The specification uses standard Z notation.
Three user-defined data types are introduced: Deg (scale degree), IntQ (interval quality) and IntN (interval name). Although degrees could be written as ˆc, ˆd, ˆe, here they are normalized as ˆ1, ˆ2, ˆ3 to remain independent of key signature.
Two relations are defined. The first maps scale degrees to an interval name: (Deg × Deg) ↔ IntN. The second maps from semitone count plus interval name to the correct quality and name: (N × IntN) ↔ (IntQ × IntN).

The schema illustrates that the interval name is derived from two pitches symbolically. For key transposition, correct enharmonic reading is maintained: for example, F♯4 in C major transposed up a perfect fifth into G major must become C♯5, not D♭5.
Chord Spelling
Chord spelling names a set of pitches according to their functional-harmony role. The example follows classical convention but could be applied across genres. Table 3 shows chord-naming in major and natural minor modes.
“The spelling of a chord is merely a name given to a set of musical properties which are usually described from a collection of pitches. Different chords are seen to carry different functions (in a functional harmony perspective, the chord built from the first note of the scale is always called the tonic). There are many chord notation styles.”
Scanning music theory textbooks reveals various conventions. This example uses Roman letters (upper and lower case) combined with numerical symbols. Quality (major, minor, augmented, diminished, half-diminished, seventh), inversion (root, first inversion, second inversion) and added notes are all described.
Five more data types extend the model: ChdN (chord name: tonic, supertonic, mediant, subdominant, dominant, submediant, leading), ChdT (chord type: major, minor, aug, dim, hdim), Inv (inversion), Dlb (doubling) and Sev (seventh omission or identity). A chord name map maps normalized scale degrees to these functional names.
A schema takes a sequence of four SATB pitches and returns chord name, type, inversion, doubling and seventh quality after filtering by supporting map relations.
This formal system demonstrates how unambiguous chord spelling—free of the ambiguities inherent in MIDI-number-based systems—can be integrated into symbolic music applications.
The methods discussed can be applied to jazz and popular music conventions as easily as to classical repertoire, giving formal symbolic reasoning a practical role across all Western art and vernacular music.
h ( , ) , ( , ), ( , ) i 7→ ( , stInversion,root,null), h ( , ) , ( , ) , ( , ) i 7→ ( , stInversion,fifth,null), h ( , ) , ( , ) , ( , ) i 7→ ( , stInversion,third,null), h ( , ) , ( , ) , ( , ) i 7→ ( , stInversion,root,null), h ( , ) , ( , ) , ( , ) i 7→ ( , stInversion,fifth,null), h ( , ) , ( , ) , ( , ) i 7→ ( , stInversion,third,null), }

Bridging the gap
Opening any standard music theory book reveals a wealth of jargon — the actual terms musicians employ to describe music. These represent only a subset of what is practically used, alongside non‑standard descriptors such as fat sound or muddy sound. Figure 2 illustrates how various music concepts are hierarchically built from the basic elements of pitch and time.
Fig. 2. Music concepts form a hierarchy whose foundation rests on pitch and time. This construction generates concepts ranging from intervals of consonance and dissonance, through melodic and harmonic progressions, to texture and formal structure.
Creating music applications capable of sophisticated inference — for example, a music education package that teaches and evaluates students’ part‑writing skills — demands the kind of symbolic inference outlined in this article. This area offers exciting prospects for music education, entertainment, and edutainment, and we believe many fruitful applications await exploration.
Conclusion
Recent efforts to standardise music notation with XML — notably MusicXML [14] and IEEE P1599 [1] — have renewed interest in symbolic music computing. Symbolic computation allows examination of both reasoning processes and knowledge content. By abstracting that content to terms familiar to music theorists, such computation can replicate the reasoning that experts employ.
Many earlier symbolic‑music implementations were ad hoc, partly because no standard for symbolic music representation existed and partly because software‑development methodologies were unestablished. Consequently, most previous work remained isolated, unable to achieve mutual synergy. Developers could neither extend the code nor benefit from others’ implementations.
Code maintenance and bug fixing were also prohibitively expensive. To address these challenges, this report adopts a formal‑specification methodology. It demonstrates two fundamental symbolic reasoning processes — interval spellings and chord spelling — in a formal manner, providing a solid platform for extending more complex inferential procedures.
Using the Z notation [16], symbolic computation of two essential musicianship skills, interval spelling and chord spelling, is presented here. The approach computes intervals and chords unambiguously, enabling discussion of music in the way music literates do. From these primitives, further musical knowledge can be built and expanded upon — for instance, voice‑leading theory or tonal theory. We believe this method can deliver mutual benefit to industrial parties involved in music delivery, retrieval, and education.
References
- Baggi, D.L.: An IEEE Standard for Symbolic Music, IEEE Computer, vol. 38(11), pp. 100‑102. (2005)
- Bel, B.: Symbolic and Sonic Representations of Sound‑object Structures, In: Balaban, M., Ebcioğlu, K., Laske, O. (eds.) Understanding Music with AI: Perspectives on music cognition, chapter 4, pp. 65‑109. The AAAI Press/The MIT Press, (1992)
- Bellini, P., Nesi, P., Zoia, G.: Symbolic Music Representation in MPEG, IEEE Multimedia, vol. 12(4), pp. 42‑49, (2005)
- Brown, G.J., Cooke, M.: Computational Auditory Scene Analysis, Computer Speech and Language, vol. 8, pp. 297‑336, (1994)
- Butterworth, A.: Stylistic Harmony, Oxford University Press (1994)
- Courtot, F.: Logical Representation and Induction for Computer‑Assisted Composition, In: Balaban, M., Ebcioğlu, Laske, O. (eds.) Understanding Music with AI: Perspectives on music cognition, chapter 7, pp. 157‑181. The AAAI Press/The MIT Press (1992)
- Good, M.: MusicXML for Notations and Analysis, In: Hewlett, W.B., Selfridge‑Field, E. (eds.) The Virtual Score Representation, Retrieval, Restoration, pp. 113‑124. The MIT Press (2001)
- Harris, M., Wiggins, G., Smaill, A.: Representing Music Symbolically, In: Camurri, A., de Poli, G. (eds.) Proceedings of the IX Colloquio di Informatica Musicale. Also Research Paper 562, Department of Artificial Intelligence, University of Edinburgh, (1991)
- Huron, D.: Design Principles in Computer‑based Music Representation, In: Marsden, A., Pople, A. (eds.) Computer Representations and Model in Music. pp. 5‑40, Academic Press, (1992)
- Knopke, I.: The Perlhumdrum and Perllilypond Toolkits for Symbolic Music Information Retrieval, In: Proceedings of the International Symposium on Music Information Retrieval, pp. 147‑152. (2008)
- Palisca, C.V.: Theory, In: Sadie, S. (ed.) The New Grove Dictionary of Music and Musicians, vol. 25, pp. 359‑385. London: Macmillan Publishers Ltd (1980)
- Piston, W.: Harmony: Revised and expanded by Mark Devoto, Victor Gollancz Ltd. (1982)