一句话:评述《The Haskell School of Music》,介绍其用 Haskell 与 Euterpea 统一音乐符号表示、演奏控制与音频合成的教学路径。
本文是对 Hudak 与 Quick 所著《The Haskell School of Music》的书评。该书用 Haskell 及 Euterpea 等库教授计算机音乐,以音高、旋律、和弦等例子引入类型、多态、高阶函数、类型类、monad 和归纳证明,并讨论递归、组合、自相似序列、相位、L-system 与 Markov 链等算法作曲方法。第18章起转向音频处理与合成,涵盖加法/减法合成、调制与简单物理模型,从而在同一语言框架内连接符号音符事件、演奏控制信号与音频生成。书评认为此统一表示不常见,但初学者可能因递归定义和参数化类型而吃力,熟悉函数式编程者则能欣赏其简洁灵活。
Computer languages for music have a long and interesting history.Music signal processing in particular inspired some early work on dataflow computers, and functional programming concepts are frequently associated with music because of the importance of event sequences and sample sequences in music representation.This book offers a particular approach to music computation using the Haskell programming language and two libraries written in Haskell: Euterpea for representing musical structures and Haskell School of Music for both music performance and simple graphical interfaces for control.This book is intended to teach computer music concepts along with Haskell.The many programming examples are almost exclusively drawn from music.For example, the first Haskell type expression that appears is PitchClass, the set of music note names.Similarly, functions are introduced for musical transposition, sequences are introduced through simple melodies, and so on.Some of the powerful features of Haskell are polymorphic and higher order functions, allowing music representations and operations on them to be parameterized by the details of music events.Music can be an organization of pitches, of chords, of sound qualities, etc., and abstraction can help to avoid being too rigid and limiting.On the other hand, readers are quickly forced to reckon with these abstractions.I expect beginners will struggle with recursive definitions and parametric types.For seasoned functional programmers, there is certainly some beauty in the terse yet flexible notation offered by Euterpea.One of the attractions of computers for musicians is the ability to describe music as a dynamic process or computation rather than a static score.After introducing Euterpea, this book offers examples of algorithmic composition based on recursion, combinatorics, self-similar sequences, phasing, L-systems, and Markov chains.These are interleaved with more advanced Haskell topics such as type classes, monads, and induction proofs.Most of this book is concerned with symbolic and parametric representations involving discrete notes with symbolic or numerical parameters such as pitch and loudness.Beginning with Chapter 18, this book turns to audio processing and music synthesis, which is also supported by the Euterpea library.Some basic synthesis methods are covered, including additive synthesis, subtractive synthesis, types of modulation, and simple physical models.These sound generation capabilities mean that one can write algorithms to compose music in terms of symbolic "note" events, describe the translation or "performance" of these events into detailed and nuanced control signals, and finally convert the parametric control into audio, all within one programming language framework.This is unusual, as most music programming systems focus on one representation or abstraction
@article{paperbot731,
title = {Review of “The Haskell School of Music: from Signals to Symphonies,” by Paul Hudak and Donya Quick, Cambridge University Press, 2018},
author = {ROGER B. DANNENBERG},
journal = {Journal of Functional Programming},
volume = {29},
year = {2019},
doi = {10.1017/s0956796819000091}
}