Preface |
|
xi | |
Acknowledgments |
|
xvi | |
|
1 Computer Music, Euterpea, and Haskell |
|
|
1 | (26) |
|
1.1 The Note versus Signal Dichotomy |
|
|
2 | (1) |
|
1.2 Basic Principles of Prograrnrning |
|
|
3 | (1) |
|
1.3 Computation by Calculation |
|
|
4 | (4) |
|
1.4 Expressions and Values |
|
|
8 | (1) |
|
|
9 | (2) |
|
1.6 Function Types and Type Signatures |
|
|
11 | (1) |
|
1.7 Abstraction, Abstraction, Abstraction |
|
|
12 | (9) |
|
1.8 Haskell Equality versus Musical Equality |
|
|
21 | (1) |
|
1.9 Code Reuse and Modularity |
|
|
22 | (1) |
|
1.10 [ Advanced] Programming with Numbers |
|
|
23 | (4) |
|
|
27 | (15) |
|
|
27 | (2) |
|
2.2 Notes, Music, and Polymorphism |
|
|
29 | (5) |
|
2.3 Convenient Auxiliary Functions |
|
|
34 | (5) |
|
|
39 | (3) |
|
3 Polymorphic and Higher-Order Functions |
|
|
42 | (21) |
|
|
42 | (2) |
|
3.2 Abstraction over Recursive Definitions |
|
|
44 | (3) |
|
|
47 | (2) |
|
|
49 | (5) |
|
3.5 [ Advanced] A Final Example: Reverse |
|
|
54 | (2) |
|
|
56 | (4) |
|
|
60 | (3) |
|
|
63 | (11) |
|
4.1 Transcribing an Existing Score |
|
|
63 | (2) |
|
|
65 | (2) |
|
4.3 Transcribing a More Complex Score |
|
|
67 | (5) |
|
4.4 Simple Algorithmic Composition |
|
|
72 | (2) |
|
|
74 | (10) |
|
|
74 | (1) |
|
|
75 | (2) |
|
|
77 | (3) |
|
|
80 | (1) |
|
5.5 Higher-Order Thinking |
|
|
81 | (1) |
|
5.6 Infix Function Application |
|
|
82 | (2) |
|
|
84 | (20) |
|
|
84 | (1) |
|
6.2 Inversion and Retrograde |
|
|
85 | (2) |
|
|
87 | (1) |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
89 | (2) |
|
6.7 Truncating Parallel Composition |
|
|
91 | (2) |
|
|
93 | (2) |
|
|
95 | (1) |
|
|
95 | (2) |
|
|
97 | (2) |
|
|
99 | (1) |
|
|
100 | (1) |
|
|
101 | (3) |
|
7 Qualified Types and Type Classes |
|
|
104 | (21) |
|
|
104 | (2) |
|
|
106 | (2) |
|
7.3 Defining Our Own Type Classes |
|
|
108 | (5) |
|
7.4 Haskell's Standard Type Classes |
|
|
113 | (5) |
|
7.5 Other Derived Instances |
|
|
118 | (3) |
|
|
121 | (1) |
|
7.7 Reasoning with Type Classes |
|
|
122 | (3) |
|
|
125 | (9) |
|
8.1 An Introduction to MIDI |
|
|
125 | (3) |
|
|
128 | (1) |
|
8.3 Euterpea's Playback Framework |
|
|
129 | (5) |
|
9 Interpretation and Performance |
|
|
134 | (14) |
|
|
134 | (5) |
|
|
139 | (5) |
|
9.3 Putting It All Together |
|
|
144 | (4) |
|
|
148 | (8) |
|
|
148 | (4) |
|
10.2 Self-Similar Harmony |
|
|
152 | (1) |
|
10.3 Other Self-Similar Structures |
|
|
153 | (3) |
|
|
156 | (19) |
|
11.1 Induction and Recursion |
|
|
156 | (1) |
|
11.2 Examples of List Induction |
|
|
157 | (2) |
|
11.3 Proving Function Equivalences |
|
|
159 | (3) |
|
11.4 Useful Properties on Lists |
|
|
162 | (4) |
|
11.5 Induction on the Music Data Type |
|
|
166 | (4) |
|
11.6 [ Advanced] Induction on Other Data Types |
|
|
170 | (5) |
|
|
175 | (9) |
|
|
175 | (2) |
|
|
177 | (3) |
|
12.3 The Fundamental Axiom Set |
|
|
180 | (2) |
|
12.4 Other Musical Properties |
|
|
182 | (2) |
|
13 L-Systems and Generative Grammars |
|
|
184 | (9) |
|
13.1 A Simple Implementation |
|
|
185 | (2) |
|
13.2 A More General Implementation |
|
|
187 | (2) |
|
13.3 An L-System Grammar for Music |
|
|
189 | (4) |
|
14 Random Numbers, Probability Distributions, and Markov Chains |
|
|
193 | (12) |
|
|
193 | (3) |
|
14.2 Probability Distributions |
|
|
196 | (6) |
|
|
202 | (3) |
|
|
205 | (6) |
|
|
205 | (1) |
|
|
206 | (2) |
|
15.3 Actions Are Just Values |
|
|
208 | (2) |
|
15.4 Reading and Writing MIDI Files |
|
|
210 | (1) |
|
16 Higher-Order Types and Monads |
|
|
211 | (16) |
|
|
211 | (2) |
|
|
213 | (8) |
|
|
221 | (1) |
|
|
222 | (3) |
|
16.5 Type Class Type Errors |
|
|
225 | (2) |
|
17 Musical User Interfaces |
|
|
227 | (35) |
|
|
227 | (1) |
|
|
228 | (5) |
|
|
233 | (9) |
|
17.4 Non-Widget Signal Functions |
|
|
242 | (4) |
|
|
246 | (5) |
|
17.6 Special Purpose and Custom Widgets |
|
|
251 | (5) |
|
|
256 | (6) |
|
|
262 | (20) |
|
|
262 | (11) |
|
|
273 | (9) |
|
19 Euterpea's Signal Functions |
|
|
282 | (17) |
|
19.1 The Type of Audio Signals |
|
|
282 | (7) |
|
|
289 | (1) |
|
|
290 | (2) |
|
|
292 | (7) |
|
|
299 | (19) |
|
|
299 | (6) |
|
20.2 The Discrete Fourier Transform |
|
|
305 | (10) |
|
20.3 The Fast Fourier Transform |
|
|
315 | (2) |
|
|
317 | (1) |
|
21 Additive and Subtractive Synthesis |
|
|
318 | (13) |
|
|
319 | (7) |
|
21.2 Subtractive Synthesis |
|
|
326 | (5) |
|
22 Amplitude and Frequency Modulation |
|
|
331 | (5) |
|
22.1 Amplitude Modulation |
|
|
331 | (3) |
|
22.2 Frequency Modulation |
|
|
334 | (1) |
|
|
334 | (2) |
|
|
336 | (10) |
|
|
336 | (1) |
|
|
336 | (4) |
|
23.3 Karplus-Strong Algorithm |
|
|
340 | (3) |
|
|
343 | (3) |
Appendix A The PreludeList Module |
|
346 | (9) |
Appendix B Haskell's Standard Type Classes |
|
355 | (10) |
Appendix C Built-in Types Are Not Special |
|
365 | (2) |
Appendix D Pattern-Matching Details |
|
367 | (3) |
Appendix E Haskell Quick Reference |
|
370 | (3) |
Appendix F Euterpea Quick Reference |
|
373 | (4) |
Appendix G HSoM Quick Reference |
|
377 | (2) |
Bibliography |
|
379 | (2) |
Index |
|
381 | |