AEN: Generative Music Algorithm
Each piece above is a real-time, unedited, recording of AEN’s output, with Ableton Live acting as the Receiver for the generated MIDI signals. The code is available on GitHub.
I. The Goal
AEN is my attempt at creating an algorithm which generates music that never ends. Jackson Pollock’s Number 1, 1949 continued to be between the different times I saw it, and when I saw it again, I saw something new, something different, the painting never stopped existing, playing, between the months and years that passed between my seeing it. Unlike a painting, most music has a beginning and an end. I wanted to see if I could create a piece with no beginning and no end, and the listener can stop back in for a visit, and between those visits, the music continued.
As I built the rule-based algorithm I wanted to make sure that the focus was not the code, not the engineering, but the unexplored musical world it had the potential to bring to life. I wanted to make sure I didn’t try to emulate existing music but explored new paths into composition. AEN is an extension of composition rather than a different way of composing the familiar.
Since most generative music can be set loose to generate forever, the overall idea is far from new. In fact, Brian Eno has been a prominent composer of generative music for a long time. In 1996, he composed the fascinating Generative Music 1. And wind-chimes have been a beautiful generative musical instrument since Ancient Rome.
II. The Context
At AEN’s core is the total rhythmic and harmonic independence of each voice -- it is the foundation of the algorithm. Messiaen often played independent musical ideas against each other. For example, In the third movement of the Turangalîla symphony he composes six independent musical ideas together (Messiaen 2:204).
It’s the musical equivalent of the atmosphere at the beach: crashing of the waves, relaxed conversations in all directions, the occasional laugh, seagull call that cuts through the distant classical rock emanating from a small speaker. Each sound source unfolds at its own independent pace, with its own sonic content, but when played together, they form a wonderful texture which is greater than the sum of its parts.
The name of the project is an homage to my favorite composer, Olivier Messiaen, without whose insights and teachings this project -- and many of my other projects -- would not exist.
III. Approach
AEN allows for each voice’s complete independence, complete rhythmic freedom, each voice can have its own tempo, its own rhythm, its own harmonic identity. At the core of the generative algorithm are the many component algorithms it is made up of. Each of the component algorithms -- tempo algorithm, pitch algorithm, velocity algorithm, scale algorithm -- can have multiple implementations: one implementation of the tempo algorithm may vary the voice’s tempo from x to y at a rate of z, and another implementation may simply keep the tempo steady a x. Unlimited implementations of each algorithm can be created, and each of the algorithms can be mixed and matched for each independent voice.
The key to the generative process is the decision making, where does the next rhythmic value come from, where does the next note come from, how hard should that note be played. In the simplest terms, the algorithm generates a series of messages like “play middle C softly for a quarter note.”
When generating a melody, AEN relies heavily on random choice, but its choices are limited by rules which trim down the available paths. The “next pitch” algorithm maintains the state of the current melodic contour. Melodic contours provided are very simple, and explore the Plainchant melodic progressions at the heart of all western melody (Messiaen 4:35). A simple example of a Plainchant a melodic progression is “one note up, and one note down” or “two notes up and one note down.”
Throughout AEN, I’ve further explored the musical building blocks at the core of my music over the last couple of years. The core building blocks, and the rules which have been encoded into AEN, are influenced by ideas presented in Messiaen’s Treatise on Rhythm, Color and Ornithology. In addition to citing Plainchant melodic intervals as a basis for melodic movement in western music, he presents 120 deci-talas (Messiaen 1:271), the exquisite ancient hindu rhythms, as well as the captivating harmonic possibilities provided symmetrical modes (Messiaen 7:101)
AEN is coded in Java, and as it executes, it outputs a series of MIDI signals in real-time.  AEN requires a MIDI receiver which routes the MIDI signals to electronic instruments. I used Ableton Live as the receiver and recorded the MIDI inputs in real-time. AEN could be considered an instance of an earlier form of AI, a rule-based system, a very loose type of expert system which explicitly encodes contemporary musical theory as rules solely in order to generate a series of MIDI signals.
IV. Conclusion
The provided music above is simply a recording, a short slice, of the music generation process in action. Unfortunately the format it is presented in, a track on Soundcloud, automatically imposes a beginning and an end -- in that sense, the format is an inadequate presentation of the ultimate goal stated at the beginning.
Overall, this is probably one of the most important projects I have ever undertaken because it marks the first time I’ve combined music and computer science knowledge in a way which pushes my own boundaries. It wasn’t really possible to hear the results of the algorithm until all of the components were in place, there was a long period where I kept coding, and building, and I didn't know how it was going to come together exactly. Sometimes I'm lucky to find myself somewhere new.
V. Resources