Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
The Haskell school of music : from signals to symphonies
Hudak P., Quick D., Cambridge University Press, New York, NY, 2018. 398 pp. Type: Book
Date Reviewed: Feb 19 2020

Music and mathematics have been linked since the ancient Greeks, and computing can be seen as a constructive variant of mathematics. So it is no surprise that music applications were among the first to be developed when computers were invented. Since that time, dozens of dedicated programming languages and language extensions have been introduced to make computer music thrive as a discipline at the intersection of computing and the arts.

The functional programming (FP) paradigm, with its emphasis on lists and higher-order function application, is well-suited to specifying the basic constructs and transforms at the heart of digital music processing, with its timed streams of either audio samples or musical instrument digital interface (MIDI) data. Music extensions of Haskell, the top (lazy) functional language in use today, are the focus of this 23-chapter book by the late Paul Hudak and Donya Quick. The book describes in detail the Euterpea and HSoM music libraries; however, the authors’ purpose goes even further, as it is also an introductory textbook on FP, relying exclusively on music-related applications as examples.

The book is structured into two main parts. The first one, chapters 1 through 16, introduces the basic concepts underlying FP, Haskell, and list-based manipulation functions, with examples based on symbolic music notation, that is, the representation and MIDI rendition of musical scores. The presentation of the main Haskell constructs pertains to this first part, with chapters dedicated to FP concepts such as expressions, polymorphism, list comprehension, qualified types, type classes, and induction-based proof techniques. These chapters are interleaved with musically focused chapters, providing illustrations based on notions such as notes, pitches, scores, polyphony, rhythm, and automatic composition using L-systems. An interesting chapter, at least on the formal side, is chapter 9, “Interpretation and Performance,” which shows how Euterpea-encoded musical concepts can be given a kind of mathematical semantics based on the formal definition of “players” and asynchronous musical events.

Chapter 17 is more or less the logical midpoint of the book, building a bridge between its two main parts, from symbolic music (“symphonies” in the title) to digital audio (“signals”). It focuses on musical user interfaces (UIs), the user-controlled part of an audio environment that enables the initialization, transformation, and output of sound. This unusually long chapter (35 pages) uses a variation of the functional arrows mechanism, a framework for abstracting operations on signals, to support UI signal functions. The HSoM library of UI signal functions described in this chapter provides access to graphical input/output (I/O) widgets, MIDI I/O functions, and timing data, among other features.

The shorter second part, chapters 18 through 23, targets digital audio programming, that is, programming where music flow is viewed as a timed stream of values sampled at 44.1 or 48kHz, as found in audio CDs. The Haskell-specific material here mainly consists of applying what the first part of the book covers: the type of scientific programming needed to implement, for example, the fast Fourier transform or audio filters. The amount of actual Haskell code in this second part is smaller than in the first, corresponding mostly to the presentation of the most important functions for digital signal processing (DSP) offered by Euterpea and of small code snippets that combine them. These six chapters read more like a light introduction to the key concepts of sound, audio, and DSP techniques than a textbook on FP, a description that better fits the first part.

In addition to a short bibliography and an index, the book ends with six appendices that include the most important Haskell type classes and functions, the pattern matching technique used by Haskell for function definition by case, and three quick reference cards for Haskell and the Euterpea and HSoM libraries.

This remarkable book takes an unusual pedagogical approach to the teaching of FP. Readers will gain good knowledge of the FP paradigm, Haskell, computer music, and the Euterpea and HSoM libraries. Not a bad deal for just one book. Though I found the pace of the presentation quite adequate, readers not familiar with FP will probably have to spend some quality time with the Glasgow Haskell Compiler (GHC) and interpreter to grasp some of the concepts. Some knowledge of music and music theory (scales and degrees, for instance) is assumed, though mastery of these notions is not required. I highly recommend this book to programmers interested in how the FP paradigm is used in computer music, as well as to those with a musical inclination who want to master Haskell.

More reviews about this item: Amazon, Goodreads

Reviewer:  P. Jouvelot Review #: CR146897 (2008-0184)
Bookmark and Share
  Editor Recommended
 
 
Music (J.5 ... )
 
 
Haskell (D.3.2 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Music": Date
The MIDI manual
Huber D., Sams, Indianapolis, IN, 1991. Type: Book (9780672227578)
Jun 1 1992
The making of octuor
Vaggione H. Computer Music Journal 8(2): 48-54, 1984. Type: Article
Feb 1 1985
Computers and musical style
Cope D., A-R Editions, Inc., Madison, WI, 1991. Type: Book (9780895792563)
Aug 1 1993
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy