Introduction to Digital Music with Python Programming
eBook - ePub

Introduction to Digital Music with Python Programming

Learning Music with Code

Michael S. Horn, Melanie West, Cameron Roberts

Compartir libro
  1. 260 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Introduction to Digital Music with Python Programming

Learning Music with Code

Michael S. Horn, Melanie West, Cameron Roberts

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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 fundamentals of rhythm, chord structure, and melodic composition alongside 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Introduction to Digital Music with Python Programming un PDF/ePUB en línea?
Sí, puedes acceder a Introduction to Digital Music with Python Programming de Michael S. Horn, Melanie West, Cameron Roberts en formato PDF o ePUB, así como a otros libros populares de Technology & Engineering y Acoustical Engineering. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Editorial
Focal Press
Año
2022
ISBN
9781000533415

1 Why music and coding?

DOI: 10.4324/9781003033240-1
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 context 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 complex 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 effects. Beyond production tools, live coding is an emerging form of musical performance art in which Information 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 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, technologies 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 first 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, making it a good choice for professionals working in fields 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 available for beginners who want to go deeper. What we’re offering is a different approach that combines learning music with learning code in equal measure.

1.3 What this book is

What we will do is give you an intuitive understanding of the fundamental 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 confidence 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 programming 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 first, 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) interface. 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 compositions. Both platforms are browser-based apps, so all you need to get started is a computer (tablets or Chromebooks are fine), an internet 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.
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 instructions, 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 ...

Índice