100% found this document useful (1 vote)
35 views

Full Download Introduction to Digital Music with Python Programming: Learning Music with Code 1st Edition Horn PDF DOCX

Introduction

Uploaded by

ensonfuga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
35 views

Full Download Introduction to Digital Music with Python Programming: Learning Music with Code 1st Edition Horn PDF DOCX

Introduction

Uploaded by

ensonfuga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Download Full Version ebook - Visit ebookmeta.

com

Introduction to Digital Music with Python


Programming: Learning Music with Code 1st Edition
Horn

https://ebookmeta.com/product/introduction-to-digital-music-
with-python-programming-learning-music-with-code-1st-
edition-horn/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmeta.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

Introduction to Digital Music with Python Programming:


Learning Music with Code 1st Edition Michael Horn

https://ebookmeta.com/product/introduction-to-digital-music-with-
python-programming-learning-music-with-code-1st-edition-michael-horn/

ebookmeta.com

An Introduction to Statistical Learning: with Applications


in Python Gareth James

https://ebookmeta.com/product/an-introduction-to-statistical-learning-
with-applications-in-python-gareth-james/

ebookmeta.com

An Introduction to Programming and Computer Science with


Python First Edition Clayton Cafiero

https://ebookmeta.com/product/an-introduction-to-programming-and-
computer-science-with-python-first-edition-clayton-cafiero/

ebookmeta.com

Aether Bound The Rise of Lilith 1 1st Edition Megan


Haskell

https://ebookmeta.com/product/aether-bound-the-rise-of-lilith-1-1st-
edition-megan-haskell/

ebookmeta.com
Demon Lord Retry Volume 2 1st Edition Kurone Kanzaki

https://ebookmeta.com/product/demon-lord-retry-volume-2-1st-edition-
kurone-kanzaki/

ebookmeta.com

Wildlife Conservation in Farm Landscapes 1st Edition David


Lindenmayer Damian Michael Mason Crane Sachiko Okada
Philip Barton Karen Ikin Daniel Florance
https://ebookmeta.com/product/wildlife-conservation-in-farm-
landscapes-1st-edition-david-lindenmayer-damian-michael-mason-crane-
sachiko-okada-philip-barton-karen-ikin-daniel-florance/
ebookmeta.com

Rockfall Tertiary Effects 1 1st Edition William Allen

https://ebookmeta.com/product/rockfall-tertiary-effects-1-1st-edition-
william-allen/

ebookmeta.com

Semantic Web Technologies Research and Applications


Computational Intelligence in Engineering Problem Solving
1st Edition Archana Patel
https://ebookmeta.com/product/semantic-web-technologies-research-and-
applications-computational-intelligence-in-engineering-problem-
solving-1st-edition-archana-patel/
ebookmeta.com

Promised Virgin Bellucci Mafia 1 1st Edition Jéssica


Macedo

https://ebookmeta.com/product/promised-virgin-bellucci-mafia-1-1st-
edition-jessica-macedo/

ebookmeta.com
Power Hungry Women of the Black Panther Party and Freedom
Summer and Their Fight to Feed a Movement 1st Edition
Suzanne Cope
https://ebookmeta.com/product/power-hungry-women-of-the-black-panther-
party-and-freedom-summer-and-their-fight-to-feed-a-movement-1st-
edition-suzanne-cope/
ebookmeta.com
Introduction to Digital Music
with Python Programming

Introduction to Digital Music with Python Programming provides a foundation


in music and code for the beginner. It shows how coding empowers new
forms of creative expression while simplifying and automating many of
the tedious aspects of production and composition.
With the help of online, interactive examples, this book covers the fun-
damentals of rhythm, chord structure, and melodic composition along-
side the basics of digital production. Each new concept is anchored in a
real-world musical example that will have you making beats in a matter
of minutes.
Music is also a great way to learn core programming concepts such as
loops, variables, lists, and functions, Introduction to Digital Music with Python
Programming is designed for beginners of all backgrounds, including high
school students, undergraduates, and aspiring professionals, and requires
no previous experience with music or code.

Michael S. Horn is Associate Professor of Computer Science and Learn-


ing Sciences at Northwestern University in Evanston, Illinois, where he
directs the Tangible Interaction Design and Learning (TIDAL) Lab.

Melanie West is a PhD student in Learning Sciences at Northwestern


University and co-founder of Tiz Media Foundation, a nonproft dedi-
cated to empowering underrepresented youth through science, technol-
ogy, engineering, and mathematics (STEM) programs.

Cameron Roberts is a software developer and musician living in Chicago.


He holds degrees from Northwestern University in Music Performance
and Computer Science.
Introduction to Digital
Music with Python
Programming
Learning Music with Code

Michael S. Horn, Melanie West,


and Cameron Roberts
First published 2022
by Routledge
4 Park Square, Milton Park, Abingdon, Oxon OX14 4RN
and by Routledge
605 Third Avenue, New York, NY 10158
Routledge is an imprint of the Taylor & Francis Group, an informa business
© 2022 Michael S. Horn, Melanie West, and Cameron Roberts
The right of Michael S. Horn, Melanie West, and Cameron
Roberts to be identifed as author of this work has been asserted
in accordance with sections 77 and 78 of the Copyright, Designs
and Patents Act 1988.
All rights reserved. No part of this book may be reprinted
or reproduced or utilised in any form or by any electronic,
mechanical, or other means, now known or hereafter invented,
including photocopying and recording, or in any information
storage or retrieval system, without permission in writing from
the publishers.
Trademark notice: Product or corporate names may be trademarks
or registered trademarks, and are used only for identifcation and
explanation without intent to infringe.
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Cataloging-in-Publication Data
A catalog record has been requested for this book

ISBN: 978-0-367-47083-8 (hbk)


ISBN: 978-0-367-47082-1 (pbk)
ISBN: 978-1-003-03324-0 (ebk)

DOI: 10.4324/9781003033240

Typeset in Bembo
by codeMantra
Melanie dedicates her contribution of the book to the
memory of her friend, Bernie Worrell, who taught her
how to listen.
Mike dedicates his contribution to his wife, Diana Reed,
and his children, Madeleine and Lucas.
Contents

List of fgures ix
Photo and illustration credits xiii
Foreword xiv
Acknowledgments xvi

1 Why music and coding? 1


Interlude 1: Basic pop beat 12
2 Rhythm and tempo 18
Interlude 2: Custom trap beat 49
3 Pitch, harmony, and dissonance 53
Interlude 3: Melodies and lists 68
4 Chords 71
Interlude 4: Playing chords 84
5 Scales, keys, and melody 88
Interlude 5: Lean on me 100
6 Diatonic chords and chord progressions 103
Interlude 6: Random chord progressions 114
7 Frequency, fourier, and flters 117
Interlude 7: Creative efects 136
8 Note-based production efects 140
Interlude 8: How to make a drum fll 153
9 Song composition and EarSketch 158
viii Contents
Interlude 9: How to make a snare drum riser 172
10 Modular synthesis 177
Interlude 10: Drum machine function 191
11 History of music and computing 194

Appendix A: Python reference 207


Appendix B: TunePad programming reference 231
Appendix C: Music reference 240
Index 255
Figures

1.1 A TunePad program to play a simple rock beat 5


1.2 Typical DAW software 6
1.3 TunePad project workspace 13
1.4 Selecting instruments in TunePad 13
1.5 Parts of a TunePad cell 14
1.6 Python syntax error in TunePad 15
1.7 Selecting an instrument’s voice in TunePad 16
2.1 TunePad project information bar. You can click on the
tempo, time signature, or key to change the settings for
your project 19
2.2 Standard notation example 20
2.3 Waveform representation of Figure 2.2 21
2.4 Piano or MIDI roll representation of Figure 2.2 21
2.5 Common note symbols starting with a whole note (four
beats) on the top down to 16th notes on the bottom.
The notes on each new row are half the length of the
row above 23
2.6 Drums in a typical drum kit 26
2.7 Roland 808 drum sequencer 28
2.8 Changing an instrument’s voice in TunePad 28
2.9 Example of a Python syntax error in TunePad. This line
of code was missing a parenthesis symbol 29
2.10 Calling the playNote function in TunePad with two
parameters inside the parentheses 30
2.11 How to show the print output of your code in a TunePad cell 35
2.12 Anatomy of a for loop in Python 36
2.13 Example of a Python syntax error. The command
‘ployNote’ should instead say ‘playNote’ 39
2.14 Example of a Python syntax error. Here the problem is
actually on line 1, not line 2 39
2.15 TunePad composer interface provides drum and
bass sequencers 47
x Figures
2.16 Basic drum pattern 50
2.17 Declaring a for loop for hi-hat runs in Python 51
2.18 Hi-hat stutter patterns 51
3.1 Sound is made up of compression waves of air molecules
that expand outward at a speed of around 343 meters
per second. The frequency of a sound wave refers to
how fast it vibrates; amplitude refers to the intensity of
the sound; and wavelength refers to the length of one
complete cycle of the waveform 54
3.2 Drawing of the cochlea (inner ear) 54
3.3 A waveform with varying amplitude 56
3.4 A half step is the distance between two adjacent piano
keys, measured in semitones 58
3.5 The harmonic series 60
3.6 Two waves at an interval of an octave 63
3.7 The ratio between the note C 262 Hz and the note
G 393 Hz is considered a perfect ffth 65
3.8 Select the 808 Bass voice 70
4.1 C major chord with MIDI note numbers 72
4.2 Creating chords as lists of numbers in Python. Each
major chord follows the same pattern 73
4.3 How to declare a user-defned function in
Python 74
4.4 C major chord 77
4.5 D minor chord 77
4.6 B diminished chord 78
4.7 C major 7th chord 79
4.8 D minor 7th chord 79
4.9 G dominant 7th chord 80
4.10 Csus2 chord 81
4.11 Csus4 chord 81
4.12 C augmented chord 82
5.1 Whole step and half step intervals of the C major scale 89
5.2 C Major Pentatonic Scale (top) and F♯ Major Pentatonic
Scale (bottom) 91
5.3 A representation of a list with values and indices 94
5.4 The Circle of Fifths arranges musical keys 96
6.1 The seven diatonic chords of C major 104
6.2 The dominant V and viio chords share two notes in
common. This is easy to see when you line piano
diagrams up vertically 107
6.3 Flowcharts for generating chord progressions in major
and minor keys 108
6.4 Example of using the fowchart to generate a chord
progression 108
Figures xi
6.5 C major chord in root position (top), frst inversion
(bottom left), and second inversion (bottom right) 109
6.6 Chord progression I-V-vi-IV without voice leading (top)
and with voice leading (bottom). Chords V, vi, and IV
are inverted to reduce the pitch range and to minimize
the movement of individual voices “singing” the notes
of the chords 110
7.1 Sound energy generated by a fute playing a single
note. The sound contains a series of spikes at regular
“harmonic” frequency intervals 118
7.2 Frequency combinations: fundamentals, partials,
harmonic, and inharmonic 119
7.3 A square wave (or any other audio signal) can be described
as a series of sine waves making up the partial frequencies 121
7.4 ADSR envelope 122
7.5 A spectrogram shows the intensity of frequencies in an
audio signal over time. The heatmap colors correspond
to intensity or energy at diferent frequencies. Time
is represented on the horizontal axis and frequency in
kilohertz on the vertical axis 123
7.6 Mixing console with magnetic tape 124
7.7 The mixing interface in TunePad allows you to adjust
gain, pan, and frequency response for each track
in a mix 126
7.8 Lowpass flter response curve 129
7.9 Highpass flter response curve 130
7.10 Bandpass flter response curve 131
7.11 Notch flter response curve 132
7.12 Peaking flter response curve 132
7.13 Low shelf and high shelf response curves 133
7.14 Graph of two methods for fading audio in 137
8.1 Intermediate pitches between C and C 141
8.2 Code cell in TunePad showing import statement 154
8.3 Drum fll pattern A 154
8.4 Drum fll pattern B 155
9.1 Songs are composed of nested and repeating notes,
phrases, and sections 159
9.2 The main EarSketch interface features a large library
of samples (left), an interactive timeline (middle top), a
code editor (center), and extensive documentation and
curriculum (right) 162
9.3 Close-up screenshot of EarSketch’s DAW 164
9.4 Using the ftMedia function in EarSketch 165
9.5 Snare drum riser pattern 172
9.6 Alternative snare drum riser pattern 173
xii Figures
10.1 Moog System 55 modular synthesizer 178
10.2 Audio signal from a microphone (top) and an audio
signal from an electric circuit 179
10.3 A simple Modular Synthesis patch created in TunePad 179
10.4 A patch with a delay efect 182
10.5 Two variations of an Additive Synthesis patch 184
10.6 A simple Subtractive Synthesis patch 185
10.7 An FM Synthesis patch where one sine wave is fed into
the frequency input socket of another sine wave 185
10.8 A more complex FM Synthesis patch 186
10.9 An example of physical modeling to create complex
string-like sounds 187
10.10 Complete Basic Poly/Lead patch in TunePad 188
10.11 Complete FM Synthesis example 189
11.1 The IBM 7094 computer at NASA. Public domain.
Available at Wikipedia 197
11.2 The Yamaha DX-7 200
11.3 Opcode’s Vision software for Macintosh in 1989 202
11.4 Screenshot of Teropa’s Music Mouse emulator 204
11.5 Jazz trombonist and scholar George Lewis working
on the IRCAM project. Image Credit: Michel Waisvisz
archives, ca. 1985 (used with permission) 205
A3.1 Parts of an audio wave 241
A3.2 ADSR envelope 242
A3.3 Natural notes on a keyboard 246
A3.4 Natural notes for a Treble Clef (top) and natural notes
for a Bass Clef (bottom) 247
A3.5 Circle of Fifths 250
Photo and illustration credits

George Folz (georgefolz.com) created original illustrations for


this book featured in Interludes 2, 4, and 8.
The photograph at the beginning of Chapter 3 is by
(unsplash.com/@jonathanvez)
The photograph at the beginning of Chapter 4 is by
(unsplash.com/@markus_gjengaar)
The photograph at the beginning of Chapter 5 is by
(unsplash.com/@jasmund)
The photograph at the beginning of Chapter 6 is by
(unsplash.com/@efrenbarahona3)
The photograph at the beginning of Chapter 7 is by
(unsplash.com/@pablodelafuente)
The photograph at the beginning of Chapter 8 is by
(unsplash.com/@makuph)
The photograph at the beginning of Chapter 10 is by
(unsplash.com/@didierjoomun)
The photograph at the beginning of Interlude 9 is by
(unsplash.com/@halacious)
The photograph at the beginning of Chapter 11 is by deepsonic
(fickr.com/people/73143485@N02). Creative
Commons License creativecommons.org/licenses/by/2.0.
Foreword

When I was a kid growing up in Texas, I “learned” how to play viola. I


put learned in quotes because it was really just a process of rote memori-
zation—hours and hours of playing the same songs over and over again.
I learned how to read sheet music, but only to the extent that I knew the
note names and could translate them into the grossest of physical move-
ments. I never learned to read music as literature, to understand its deeper
meaning, structure, or historical context. I never understood anything
about music theory beyond being annoyed that I had to pay attention to
accidentals in diferent keys. I never composed anything, not even infor-
mally scratching out a tune. I never developed habits of deep listening,
of taking songs apart in my head and puzzling over how they were put
together in the frst place. I never played just for fun. And, despite the best
intentions of my parents and teachers, I never fell in love with music.
Learning how to code was the complete opposite experience for me. I
was largely self-taught. The courses I took in school were electives that I
chose for myself. Teachers gave me important scafolding at just the right
times, but it never felt forced. I spent hours working on games or other
projects (probably when I should have been practicing viola). I drew art-
work, planned out algorithms, and even synthesized my own rudimentary
sound efects. I had no idea what I was doing, but that was liberating. No
one was around to point out my mistakes or to show me how to do things
the “right” way (at least, not until college). I learned how to fgure things
out for myself, and the skills I picked up from those experiences are still
relevant today. I fell in love with coding.1
But I know many people whose stories are fipped 180 degrees. For
them, music was so personally, socially, and culturally motivating that
they couldn’t get enough. They’d practice for hours and hours, not just for
fun but for something much deeper. For some it was an instrument like
the guitar that got them started. For others it was an app like GarageBand
that gave them a playful entry point into musical ideas. To the extent that
they had coding experiences, those experiences ranged from uninspiring
to of-putting. It’s not that they necessarily hated coding, but it was some-
thing they saw as not being for them.
Foreword xv
In the foreword of his book, Mindstorms: Children, Computers, and Pow-
erful Ideas, Seymour Papert wrote that he “fell in love with gears” as a way
of helping us imagine a future in which children (like me) would fall in
love with computer programming, not for its own sake, but for the cre-
ative worlds and powerful ideas that programming could open up. Part of
what he was saying was that love and learning go hand in hand, and that
computers could be an entry point into many creative and artistic domains
such as mathematics and music. Coding can revitalize subjects that have
become painfully rote in schools.
The process of developing TunePad over the past several years has been
a fascinating rediscovery of musical ideas for me. Code has given me a dif-
ferent kind of language for thinking about things like rhythm, chords, and
harmony. I can experiment with composition unencumbered by my mal-
adroit hands. Music has become something creative and alive in a way that
it never was for me before. Music theory is no longer a thicket of confusing
terminology and instead has become a fascinating world of mathematical
beauty that structures the creative process.
Melanie, Cameron, and I hope that this book gives you a similarly joy-
ful learning experience with music and code. We hope that you feel em-
powered to explore the algorithmic and mathematical beauty of music.
We hope that you discover, as we have, that music and code reinforce one
another in surprising and powerful ways that open new creative opportu-
nities for you. We hope that, regardless of your starting point—as a coder,
as a musician, as neither, as both—you will discover something new about
yourself and what you can become.

Michael Horn
Chicago, Illinois ( July 2021)

Note
1 I was also fortunate to have grown up in a time and place where these ac-
tivities were seen as socially acceptable for a person of my background and
identity.
Acknowledgments

We are grateful to the many people who have helped make this book possi-
ble. We especially want to thank Dr. Amartya Banerjee who has anchored
the TunePad development team. The TunePad project grew out of a col-
laboration with the EarSketch team at Georgia Tech that was initiated by
Dr. Brian Magerko and Dr. Jason Freeman. We thank Dr. Nichole Pinkard,
Dr. Amy Pratt, and the Northwestern Ofce of Community Education
Partnerships. We thank the TIDAL Lab team at Northwestern University
including Mmachi Obiorah, Wade Berger, Izaiah Wallace, Brian Andrus,
Jamie Gorrson, Matthew Brucker, Lexie Zhao, Ayse Hunt, Kallayah
Henderson, Cortez Watson Jr., Sachin Srivastava, and many, many oth-
ers. We thank our community partners including the Evanston Public
Library, the NAACP of DuPage County, the James R. Jordan Foun-
dation, the Meta Media program at the McGaw YMCA, the Hip-Hop
FIRM, EvanSTEM, the Center for Creative Entrepreneurship, Studio
2112, the James R. Jordan Boys and Girls Club, Lake View High School
and Marshaun Brooks, Lane Tech High School and Amy Wozniak, Gary
Comer Youth Centers, and Chicago Youth Centers, Project Exploration,
BBF Family Services, and the Museum of Science and Industry. Shout-
outs to Marcus Prince and Sam Carroll who gave us insightful curriculum
ideas, to Tom Knapp who contributed to TunePad’s graphical design, and
to the amazing interns we’ve worried with over the years.
Special thanks go to the people who gave input into the ideas and text
of this manuscript including George Papajohn and Diana Reed. We also
thank Joseph Mahanes, Abbie Reeves, and others who put up with us
while we worked on this book.
TunePad was created by the Tangible Interaction Design and Learn-
ing (TIDAL) Lab at Northwestern University in collaboration with the
EarSketch team at the Georgia Institute of Technology and with fund-
ing from the National Science Foundation (grants DRL-1612619, DRL-
1451762, and DRL-1837661) and the Verizon Foundation. Any opinions,
fndings, and/or recommendations expressed in the material are those of
the authors and do not necessarily refect the views of the funders.
1 Why music and coding?

Welcome to Introduction to Digital Music with Python: Learning Music with


Code. This book is designed for people who love music and are interested in
the intersection of music and coding. Maybe you’re an aspiring musician
or music producer who wants to know more about coding and what it can
do. Or maybe you already know a little about coding, and you want to
expand your creative musical horizon. Or maybe you’re a total beginner
in both. Regardless of your starting point, this book is designed for you to
learn about music and coding as mutually reinforcing skills. Code gives us
an elegant language to think about musical ideas, and music gives us a con-
text within which code makes sense and is immediately useful. Together
they form a powerful new way to create music that will be interconnected
with digital production tools of the future.
More and more code will be used to produce music, to compose music,
and even to perform music for live audiences. Digital production tools
such as Logic, Reason, Pro Tools, FL Studio, and Ableton Live are com-
plex software applications created with millions of lines of code written by
huge teams of software engineers. With all of these tools you can write
code to create custom plugins and efects. Beyond production tools, live
coding is an emerging form of musical performance art in which Infor-
mation Age DJs write computer code to generate music in real time for
live audiences.
In other ways, we’re still on the cusp of a radical transformation in the
way that we use code to create music. The history of innovation in music
has always been entwined with innovation in technology. Whether we’re
DOI: 10.4324/9781003033240-1
2 Why music and coding?
talking about Franz Liszt in the 19th century, who pioneered the persona
of the modern music virtuoso based on technological breakthroughs of
the piano,1 or DJ Kool Herc in the 20th century, who pioneered hip-hop
with two turntables and a crate full of funk records in the Bronx, tech-
nologies have created new opportunities for musical expression that have
challenged the status quo and given birth to new genres. We don’t have
the Franz Liszt or DJ Kool Herc of coding yet, but it’s only a matter of
time before the coding virtuosos of tomorrow expand the boundaries of
what’s possible in musical composition, production, and performance.

1.1 What is Python?


In this book you’ll learn how to create your own digital music using a
computer programming language called Python. If you’re not familiar
with programming languages, Python is a general-purpose language frst
released in the 1990s that is now one of the most widely used languages in
the world. Python is designed to be easy to read and write, which makes it
a popular choice for beginners. It’s also fully featured and powerful, mak-
ing it a good choice for professionals working in felds as diverse as data
science, web development, the arts, and video game development. Because
Python has been around for decades, it runs on every major computer
operating system. The examples in this book even use a version of Python
that runs directly inside of your web browser without the need for any
special software installation.
Unlike many other common beginner programming languages, Python
is “text-based”, which means that you type code into an editor instead of
dragging code blocks on the computer screen. This makes Python a little
harder to learn than other beginner languages, but it also greatly expands
what you can do. By the time you get through this book you should feel
comfortable writing short Python programs and have the conceptual tools
you need to explore more on your own.

1.2 What this book is not


Before we get into a concrete example of what you can do with a little bit
of code, just a quick note about what this book is not. This book is not a
comprehensive guide to Python programming. There are many excellent
books and tutorials designed for beginners, several of which are free.2
This book is also not a comprehensive guide to music theory or Western
music notation. We’ll get into the core ideas behind rhythm, harmony,
melody, and composition, but there are, again, many other resources avail-
able for beginners who want to go deeper. What we’re ofering is a dif-
ferent approach that combines learning music with learning code in equal
measure.
Why music and coding? 3
1.3 What this book is
What we will do is give you an intuitive understanding of the fundamen-
tal concepts behind both music and coding. Code and music are highly
technical skills, full of arcane symbols and terminology, that seem almost
designed to intimidate beginners. In this book we’ll put core concepts
to use immediately to start making music. You’ll get to play with ideas
at your own pace and get instant feedback as you bring ideas to life. We
skip most of the technical jargon and minutiae for now—that can come
later. Instead, we focus on developing your confdence and understanding.
Importantly, the skills, tools, and ways of thinking that we introduce in
this book will be broadly applicable in many other areas as well. You’ll be
working in Python code, but the core structures of variables, functions,
loops, conditional logical, and classes are the same across many program-
ming languages including JavaScript, Java, C, C++, and C#. After you
learn one programming language, each additional language is that much
easier to pick up.

1.4 TunePad and EarSketch


This book uses two free online platforms that combine music and
Python coding. The frst, called TunePad (https://tunepad.com), was
developed by a team of researchers at Northwestern University in
Chicago. TunePad lets you create short musical loops that you can
layer together using a simple digital audio workstation (DAW) inter-
face. The second platform, called EarSketch (https://earsketch.gatech.
edu), was created by researchers at Georgia Tech in Atlanta. EarSketch
uses Python code to arrange samples and loops into full-length com-
positions. Both platforms are browser-based apps, so all you need to
get started is a computer (tablets or Chromebooks are fne), an inter-
net connection, and a web browser like Chrome or Firefox. External
speakers or headphones are also nice but not required. Both platforms
have been around for years and have been used by many thousands
of students from middle school all the way up to college and beyond.
TunePad and EarSketch are designed primarily as learning platforms,
but there are easy ways to export your work to professional production
software if you want to go further.

1.5 A quick example


Here’s a quick example of what coding in Python looks like. This program
runs in TunePad to create a simple beat pattern, variants of which have
been used in literally thousands of songs such as Blinding Lights by The
Weeknd and Roses by SAINt JHN.
4 Why music and coding?

1 playNote(1) # play a kick drum sound


2 playNote(2) # play a snare drum sound
3 playNote(1)
4 playNote(2)
5 rewind(4) # rewind 4 beats
6 for i in range(4):
7 rest(0.5)
8 playNote(4, beats = 0.5) # play hat for a half beat

These eight lines of Python code tell TunePad to play a pattern of kick
drums, snare drums, and high-hats. Most of the lines are playNote in-
structions, and, as you might have guessed, those instructions tell TunePad
to play musical sounds indicated by the numbers inside of the parentheses.
This example also includes something called a loop on line 6. Don’t worry
too much about the details yet, but the loop is an easy way to repeat a set
of actions over and over again. In this case, the loop tells Python to repeat
lines 7 and 8 four times in a row. The screenshot (Figure 1.1) shows what
this looks like in TunePad. You can try out the example for yourself with
this link: https://tunepad.com/examples/roses.

1.6 Five reasons to learn code


Now that you’ve seen a brief example of what you can do with a few lines
of Python code, here are our top fve reasons to get started with program-
ming and music if you’re still in doubt.

1.6.1 REASON 1: Like it or note, music is already defned by code


Looking across the modern musical landscape, it’s clear that music is al-
ready defned by code. One of the biggest common factors of almost all
modern music from any popular genre is that everything is edited, if not
created entirely, with sophisticated computer software. It’s hard to over-
state how profoundly such software has shaped the sound of music in the
21st century. Relatively inexpensive DAW applications and the myriad
ubiquitous plugins that work across platforms have had a disruptive and
democratizing efect across the music industry. Think about efects plugins
like autotune, reverb, or the ability to change the pitch of a sample with-
out changing the tempo. These efects are all generated with sophisticated
software. Production studios the size of small ofces containing hundreds
of thousands of dollars’ worth of equipment now ft on the screen of a
laptop computer available to any aspiring producer with passion, a WiFi
Why music and coding? 5

Figure 1.1 A TunePad program to play a simple rock beat.

connection, and a small budget. The reasons behind the shift to digital
production tools are obvious. Computers have gotten to a point where
they are cheap enough, fast enough, and capacious enough to do real-time
audio editing. We can convert sound waves into editable digital informa-
tion with microsecond precision and then hear the efects of our changes
in real time. These DAWs didn’t just appear out of nowhere. They were
constructed by huge teams of software engineers writing code—millions
of lines of it. As an example, TunePad was created with over 1.5 million
lines of code written in over a dozen computer languages such as Python,
HTML, JavaScript, CSS, and Dart. Regardless of how you feel about the
digital nature of modern music, it’s not going away. Learning to code will
6 Why music and coding?

Figure 1.2 Typical DAW software.

help you understand a little more about how all of this works under the
hood. More to the point, it’s increasingly common for producers to write
their own code to manipulate sound. For example, in Logic, you can write
JavaScript code to process incoming MIDI (Musical Instrument Digital
Interface) data to do things like create custom arpeggiators. Learning to
code can give you more control and help expand your creative potential
(Figure 1.2).

1.6.2 REASON 2: Code is a powerful way to make music


We don’t always think about it this way, but music is algorithmic in
nature—it’s full of mathematical relationships, logical structure, and
recursive patterns. The beauty of the Baroque fugue is in part a re-
fection of the beauty of the mathematical and computational ideas
behind the music. We call Bach a genius not just because his music is
so compelling, but also because he was able to hold complex algorithms
in his mind and then transcribe them to paper using the representation
system that we call Western music notation. In other words, music
notation is a language for recording the output of the composition
process, but not a language for capturing the algorithmic nature of the
composition process itself.
Code, on the other hand, is a language specifcally designed to capture
mathematical relationships, logical structure, and recursive patterns. For
example, take the stuttered hi-hat patterns that are one of the defning
characteristics of trap music. Here are a few lines of Python code that gen-
erate randomized hi-hat stutters that can bring an otherwise conventional
beat to life with sparkling energy.
Why music and coding? 7

1 for _ in range(16):
2 if randint(6) > 1: # roll the die for a random number
3 playNote(4, beats=0.5) # play an eighth note
4 else:
5 playNote(4, beats=0.25) # or play 16th notes
6 playNote(4, beats=0.25)

Or, as another example, here’s a two-line Python program that plays a


snare drum riser efect common in house, EDM, or pop music. You’ll of-
ten hear this technique right before the beat drops. This code uses a decay
function so that each successive note is a little shorter resulting in a gradual
acceleration efect. Don’t worry about how all of this works just yet. We’ll
walk you through the details as we go along.

1 for i in range(50): # play 50 snares


2 playNote(2, beats = pow(2, -0.09 * i))

What’s cool about these efects is that they’re parameterized. Because the
code describes the algorithms to generate music, and not the music itself, it
means we can create infnite variation by adjusting the numbers involved.
For example, in the trap hi-hat code, we can easily play around with how
frequently stuttered hats are inserted into the pattern by increasing or de-
creasing one number. You can think of code as something like a power drill;
you can swap out diferent bits to make holes of diferent sizes. The drill bits
are like parameters that change what the tool does in each specifc instance.
In the same way, algorithms are vastly more general-purpose tools that can
accomplish myriad tasks by changing the input parameters.
Creating a snare drum riser with code is obviously a very diferent kind
of thing than picking up two drumsticks and banging out a pattern on
a real drum. And, to be clear, we’re not advocating for code to replace
learning how to perform with live musical instruments. But, code can be
another tool in your musical repertoire for generating repetitive patterns,
exploring mathematical ideas, or playing sequences that are too fast or
intricate to play by hand.

1.6.3 REASON 3: Code lets you build your own musical toolkit
Becoming a professional in any feld is about developing expertise with
tools—acquiring equipment and knowing how to use it. Clearly, this
is true in the music industry, but it’s also true in software. Professional
software engineers acquire specialized equipment and software packages.
They develop expertise in a range of programming languages and techni-
cal frameworks. But, they also build their own specialized tools that they
use across projects. In this book, we’ll show you how to build up your own
8 Why music and coding?
library of Python functions. You can think of functions as specialized tools
that you create to perform diferent musical tasks. In addition to the exam-
ples we described above, you might write a function to generate a chord
progression or play an arpeggio, and you can use functions again and again
across many musical projects.

1.6.4 REASON 4: Code is useful for a thousand and one other things
As we mentioned earlier in this chapter, Python is one of the most power-
ful, multi-purpose languages in the world. It’s used to create web servers
and social media platforms as much as video games, animation, and music.
It’s used for research and data science, politics and journalism. Knowing a
little Python gives you access to powerful machine learning and artifcial
intelligence (AI/ML) techniques that are poised to transform most aspects
of human work, including in creative domains such as music. Python is
both a scripting language and a software engineering platform—equal
parts duct tape and table saw—and it’s capable of everything from quick
fxes to durable software applications. Learning a little Python won’t make
you a software engineer, just like learning a few guitar chords won’t make
you a performance musician. But it’s a start down a path. An open door
that was previously closed, and a new way of using your mind and a new
way of thinking about music.

1.6.5 REASON 5: Coding makes us more human


When we think about learning to code, we tend to think about the eco-
nomic payof. You’ll hear arguments that learning to code is a resume
builder and a path to a high-paying job. It’s not that this perspective is
wrong, but it might be the wrong reason for you to learn how to code.
Just like people who are good at music love music, people who are good
at coding tend to love coding. The craft of building software can be te-
dious and frustrating, but it can also be rewarding. It’s a way to express
oneself creatively and to engage in craftwork. People don’t learn to knit,
cook, or play an instrument for the lucrative career paths that these pur-
suits open up—although by all means those pursuits can lead to remark-
able careers. People learn these things because they have a passion for them.
Because they are personally fulflling. These passions connect us to cen-
turies of tradition; they connect us to communities of teachers, learners,
and practitioners; and, in the end, they make us more human. So when
things get a little frustrating—and things always get a little frustrating
when you’re learning any worthwhile skill—remember that just like po-
etry, literature, or music, code is an art as much as it is a science. And, just
like woodworking, knitting, or cooking, code is a craft as much as it is
an engineering discipline. Be patient and give yourself a chance to fall in
love with coding.
Why music and coding? 9
1.7 The future of music and code
Before we get on with the book, we wanted to leave you with a brief
thought about the future of technology, music, and code. For as long as
there have been people on this planet there has been music. And, as long
as there has been music, people have created technology to expand and en-
hance their creative potential. A drum is a kind of technology—a piece of
animal hide stretched across a hollow log and tied in place. It’s a polylithic
accomplishment, an assembly of parts that requires skill and craft to make.
One must know how to prepare animal hide, to make rope from plant
fber, and to craft and sharpen tools. More than that, one must know how
to perform with the drum, to connect with an audience, to enchant them
to move their bodies through an emotional and rhythmic connection to
the beat. Technology brings together materials and tools with knowledge.
People must have knowledge both to craft an artifact and to wield it. And,
over time—over generations—that knowledge is refned as it gets passed
down from teacher to student. It becomes stylized and diversifed. Tools,
artifacts, knowledge, and practice all become something greater. Some-
thing we call culture.
Again and again the world of music has been disrupted, democratized,
and redefned by new technologies. Hip-hop was a rebellion against the
musical status quo fueled by low-cost technologies like recordable cas-
sette tapes, turntables, and 808 drum machines. Early innovators shat-
tered norms of artistic expression, redefning music, poetry, visual art,
and dance in the process. Inexpensive access to technology coupled with
a need for new forms of authentic self-expression was a match to the dry
tinder of racial and economic oppression.
It’s hard to overstate how quickly the world is still changing as a re-
sult of technological advancements. Digital artifacts and infrastructures
are so ubiquitous that they have reconfgured social, economic, legal, and
political systems; revolutionized scientifc research; upended the arts and
culture; and even wormed their way into the most intimate aspects of our
personal and romantic lives. We’ve already talked about the transforma-
tive impact that digital tools have had on the world of music in the 21st
century, but the exhilarating (and scary) part is that we’re on the precipice
of another wave of transformation in which human creativity will be re-
defned by Artifcial Intelligence AI and Machine Learning ML. Imagine
AI accompanists that can improvise harmonies or melodies in real time
with human musicians. Or deep learning algorithms that can listen to
millions of songs and innovate music in the same genre. Or silicon poets
that grasp human language well enough to compose intricate rap lyrics.
Or machines with trillions of transistor synapses so complex that they be-
gin to “dream”—inverted machine learning algorithms that ooze imagery
unhinged enough to disturb the absinthe slumber of surrealist painters.
Now, imagine that this is not speculative science fction, but the reality of
10 Why music and coding?
our world today. These things are here now and already challenging what
we mean by human creativity. What are the implications of a society of
digital creative cyborgs?
But here’s the trick: we’ve always been cyborgs. Western music notation
is as much a technology as Python code. Becoming literate in any suf-
ciently advanced representation system profoundly shapes how we think
about and perceive the world around us. Classical music notation, theory,
and practice shaped the mind of Beethoven as much as he shaped music
with it—so much so that he was still able to compose many of his most
famous works while almost totally deaf. Beethoven was a creative cyborg
enhanced by the technology of Western music notation and theory. The
diference is that now we’ve externalized many of the cognitive processes
into machines that think alongside us. And, increasingly, these tools are
available to everyone. How that changes what it means to be a creative
human being is anyone’s guess.

1.8 Book overview


We’re excited to have you with us on this journey through music and
code. Here’s a short guide for where we go from here. Chapters 2 and 3
cover the foundations of rhythm, pitch, and harmony. These chapters are
designed to move quickly and get you coding in Python early on. We’ll
cover Python variables, loops, which both connect directly to musical
concepts. Chapters 4, 5, and 6 cover the foundations of chords, scales,
and keys using Python lists, functions, and data structures. Chapters 7, 8,
and 10 shift from music composition to music production covering topics
such as the frequency domain, modular synthesis, and other production
efects. In Chapter 9, we switch to the EarSketch platform to talk about
how various musical elements are combined to compose full-length songs.
Finally, Chapter 11 provides a short overview of the history of music and
code along with a glimpse of what the future might hold. Between each
chapter, we provide a series of short interludes that are like step-by-step
tutorials to introduce new music and coding concepts.
A few notes about how to read this book. Any time we include Python
code, it will be shown in a programming font like this:
playNote(60)

Sometimes we’ll write code in a table with line numbers so that we can re-
fer to specifc lines. When we introduce new terms, we’ll bold the word.
If you get confused by any of the programming or music terminology,
check out the appendices, which contain quick overviews of all of the
important concepts. We’ll often invite you to follow along with online
examples. The best way to learn is by doing it yourself, so we strongly
Why music and coding? 11
encourage you to try coding in Python online as you go through the
chapters.

Notes
1 It’s said that fans were so infatuated with Liszt’s piano “rockstar” status that
they fought over his silk handkerchiefs and velvet gloves at his performances.
2 We recommend https://www.w3schools.com/python/.
Interlude 1
BASIC POP BEAT

In this interlude we’re going to get familiar with the TunePad interface by
creating a basic rock beat in the style of songs like Roses by SAINt JHN.
You can follow along online by visiting
https://tunepad.com/interlude/pop-beat

STEP 1: Deep listening


It’s good to get in the habit of deep listening. Deep listening is the prac-
tice of trying every possible way of listening to sounds. Start by loading a
favorite song in a streaming service and listening—really listening—to it.
Take the song apart element by element. What sounds do you hear? How
are they layered together? When do diferent parts come into the track and
how do they change over time? Think about how the producer balances
sounds across the frequency spectrum or opens up space for transitions in
the lyrics. Try focusing on just the drums. Can you start to recognize the
individual percussion sounds and their rhythmic patterns?

STEP 2: Create a new TunePad project


Visit https://tunepad.com on a laptop or Chromebook and set up an account.1
If you already have a gmail address, you can use your existing account. Af-
ter signing in, click on the New Project button to create an empty project
workspace. Your project will look something like this (Figure 1.3):

DOI: 10.4324/9781003033240-2
Basic pop beat 13

Figure 1.3 TunePad project workspace.

STEP 3: Kick drums


In your project window, click on the ADD CELL button and then select
Drums (Figure 1.4).
In TunePad you can think of a “cell” as an instrument that you can
program to play music. Name the new instrument “Kicks” and then add
this Python code.

1 # play four kick drums


2 playNote(1)
3 playNote(1)
4 playNote(1)
5 playNote(1)

Figure 1.4 Selecting instruments in TunePad.


Discovering Diverse Content Through
Random Scribd Documents
LONDON: PRINTED BY WILLIAM CLOWES AND SONS, LIMITED,
STAMFORD STREET AND CHARING CROSS.
Transcriber’s Notes
Punctuation, hyphenation, and spelling were made
consistent when a predominant preference was found in the
original book; otherwise they were not changed.
Simple typographical errors were corrected; unbalanced
quotation marks were remedied when the change was
obvious, and otherwise left unbalanced.
Illustrations in this eBook have been positioned between
paragraphs.
The index was not checked for proper alphabetization or
correct page references.
*** END OF THE PROJECT GUTENBERG EBOOK COLOUR VISION
***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.

You might also like