Functional Modelling of Musical Harmony--An experience report

J.P. Rodrigues Magalhães, W.B. de Haas

Research output: Chapter in Book/Report/Conference proceedingConference contributionAcademicpeer-review

Abstract

Music theory has been essential in composing and performing music for centuries. Within Western tonal music, from the early Baroque on to modern-day jazz and pop music, the function of chords within a chord sequence can be explained by harmony theory. Although Western tonal harmony theory is a thoroughly studied area, formalising this theory is a hard problem. We present a formalisation of the rules of tonal harmony as a Haskell (generalized) algebraic datatype. Given a sequence of chord labels, the harmonic function of a chord in its tonal context is automatically derived. For this, we use several advanced functional programming techniques, such as type-level computations, datatype-generic programming, and error-correcting parsers. As a detailed example, we show how our model can be used to improve content-based retrieval of jazz songs. We explain why Haskell is the perfect match for these tasks, and compare our implementation to an earlier solution in Java. We also point out shortcomings of the language and libraries that limit our work, and discuss future developments which may ameliorate our solution.
Original languageUndefined/Unknown
Title of host publicationProceedings of the 16th ACM SIGPLAN International Conference on Functional Programming
Place of PublicationTokyo, Japan
Publication statusPublished - 2011

Cite this