Computers are everywhere. And so is music! Although some might think of the two as being at best distant relatives, in fact they share many deep properties. Music comes from the soul, and is inspired by the heart, yet it has the mathematical rigor of computers. Computers have mathematical rigor of course, yet the most creative ideas in mathematics and computer science come from the soul, just like music. Both disciplines demand both left-brain and right-brain skills. It always surprises me how many computer scientists and mathematicians have a serious interest in music. It seems that those with a strong affinity or acuity in one of these disciplines is often strong in the other as well.
It is quite natural then to consider how the two might interact. In fact there is a long history of interactions between music and mathematics, dating back to the Greeks’ construction of musical scales based on arithmetic relationships, and including many classical composers use of mathematical structures, the formal harmonic analysis of music, and many modern music composition techniques. Advanced music theory uses ideas from diverse branches of mathematics such as number theory, abstract algebra, topology, category theory, calculus, and so on.
There is also a long history of efforts to combine computers and music. Most consumer electronics today are digital, as are most forms of audio processing and recording. But in addition, digital musical instruments provide new modes of expression, notation software and sequencers have become standard tools for the working musician, and those with the most computer science savvy use computers to explore new modes of composition, transformation, performance, and analysis.
This textbook explores the fundamentals of computer music using a language-centric approach. In particular, the functional programming language Haskell is used to express all of the computer music concepts. Thus a by-product of learning computer music concepts will be learning how to program in Haskell. The core musical ideas are collected into a Haskell library called Euterpea. The name “Euterpea” is derived from “Euterpe,” who was one of the nine Greek muses, or goddesses of the arts, specifically the muse of music. A hypothetical picture of Euterpe graces the cover of this textbook.