It's part learning exercise, part experiment. There already exist many ways to make generative music, but this book is about learning how to create something from scratch. The best way to understand something is to teach it, as they say.
It's also an experiment, in that the results are uncertain. We can fairly easily write a program to generate noise, and with a little work even something that sounds vaguely like music, but can we make something that approaches the qualities of "real" music?
To help us focus, the book has a few guiding principles:
Fun over rigour: We'll take inspiration from nature and science, but feel free to take some artistic license along the way.
Composition over sound design: The focus will be on creating musical structures, with sound generation / synthesis delegated to software instruments.
Algorithms over performance: We're aiming for music that is self evolving and requires no interaction from us or the listener (in contrast with live coding).
Simple building blocks: We'll build things from the ground up. As we go we'll encapsulate our learning into a set of modules we can plug together to make more sophisticated music.
To help us get started, the book begins with short primers on each of its three subjects:
Generative: Here we define what we mean by "generative", and cover how generative processes can be applied to creating art and music.
Music: Here we explain the building blocks of music: melody, harmony and rhythm.
With that under our belts, the main part of the book guides us through applying these ideas to making some noise, and potentially, music! Each chapter is based around exploring the musical potential of one generative idea:
Hello World: The basics of how to play a single note, multiple notes, notes over time.
Walker: Taking a random walk around the keyboard.
Matrix: Building a pattern sequencer. Transforming patterns.
Web of data
There are a few essentials you'll need to follow along with the examples:
- A web browser that supports the Web MIDI API (e.g. Chrome)
- A code editor (e.g. Atom)
- A way to internally route MIDI
- A DAW or soft synth where MIDI can be routed
This book is heavily inspired by The Nature of Code by Daniel Shiffman. A lot of the generative ideas are taken from there and just reconfigured to apply to music. I really recommend reading it!
The design of the Gem.js library is inspired by Overtone.