Table of Contents
List of Figures
List of Tables
Preface
Computer Music, Euterpea, and Haskell
The Note vs. Signal Dichotomy
Basic Principles of Programming
Computation by Calculation
Expressions and Values
Types
Function Types and Type Signatures
Abstraction, Abstraction, Abstraction
Haskell Equality vs. Euterpean Equality
Code Reuse and Modularity
[Advanced] Programming with Numbers
Simple Music
Preliminaries
Notes, Music, and Polymorphism
Convenient Auxiliary Functions
Absolute Pitches
Polymorphic & Higher-Order Functions
Polymorphic Types
Abstraction Over Recursive Definitions
Append
Fold
[Advanced] A Final Example: Reverse
Currying
Errors
A Musical Interlude
Modules
Transcribing an Existing Score
Simple Algorithmic Composition
Syntactic Magic
Sections
Anonymous Functions
List Comprehensions
Function Composition
Higher-Order Thinking
Infix Function Application
More Music
Delay and Repeat
Inversion and Retrograde
Polyrhythms
Symbolic Meter Changes
Computing Duration
Super-retrograde
takeM and dropM
Removing Zeros
Truncating Parallel Composition
Trills
Grace Notes
Percussion
A Map for Music
A Fold for Music
Crazy Recursion
Qualified Types and Type Classes
Motivation
Equality
Defining Our Own Type Classes
Haskell's Standard Type Classes
Other Derived Instances
The type of play
Reasoning With Type Classes
Interpretation and Performance
Abstract Performance
Players
Putting it all Together
Self-Similar Music
Self-Similar Melody
Self-Similar Harmony
Other Self-Similar Structures
Proof by Induction
Induction and Recursion
Examples of List Induction
Proving Function Equivalences
Useful Properties on Lists
Induction on the Music Data Type
[Advanced] Induction on Other Data Types
An Algebra of Music
Musical Equivalance
Some Simple Axioms
The Fundamental Axiom Set
An Algebraic Semantics
Other Musical Properties
L-Systems and Generative Grammars
Generative Grammars
An L-System Grammar for Music
Random Numbers ... and Markov Chains
Random Numbers
Probability Distributions
Markov Chains
From Performance to Midi
An Introduction to Midi
Converting a Performance into Midi
Putting It All Together
Basic Input/Output
IO in Haskell
do Syntax
Actions are Just Values
Reading and Writing MIDI Files
Higher-Order Types and Monads
The Functor Class
The Monad Class
The MonadPlus Class
State Monads
Type Class Type Errors
Musical User Interface
Introduction
Basic Concepts
The UISF Arrow
Non-Widget Signal Functions
Musical Examples
Special Purpose and Custom Widgets
Advanced Topics
Sound and Signals
The Nature of Sound
Digital Audio
Euterpea's Signal Functions
Signals and Signal Functions
Generating Sound
Instruments
Spectrum Analysis
Fourier's Theorem
The Discrete Fourier Transform
The Fast Fourier Transform
Further Pragmatics
References
Additive and Subtractive Synthesis
Additive Synthesis
Subtractive Synthesis
Amplitude and Frequency Modulation
Amplitude Modulation
Frequency Modulation
Physical Modelling
Introduction
Delay Lines
Karplus-Strong Algorithm
Waveguide Synthesis
Sound Effects
Appendix
The PreludeList Module
The PreludeList Module
Simple List Selector Functions
Index-Based Selector Functions
Predicate-Based Selector Functions
Fold-like Functions
List Generators
String-Based Functions
Boolean List Functions
List Membership Functions
Arithmetic on Lists
List Combining Functions
Haskell's Standard Type Classes
The Ordered Class
The Enumeration Class
The Bounded Class
The Show Class
The Read Class
The Index Class
The Numeric Classes
Built-in Types Are Not Special
Pattern-Matching Details
Bibliography