Trained/"Trane'd" Music Improvisation Generator

As part of Alexa Sharp’s Artificial Intelligence class at Oberlin Nick Towbin-Jones and I created a program that utilized Markov Models to generate jazz improvisations over chords in the “style” of an artist. We focused on the solos of John Coltrane, but solos by any single line instrument (flute, trumpet, etc.) could be modeled.

The program takes in a transcription of a solo in MIDI format, a specially formatted list of chords (e.g. “Dm 4, Ad 2” for 4 beats of D minor chord, 2 beats of A diminished 7th), and then an “order” parameter, which determines roughly how many notes in the solo will be viewed as a unified “gesture” (our default was 3). The content of the solo is assumed to correspond exactly to the chords in the chord list (a solo played over a jazz standard).

The computer then builds a Markov model from 1) consecutive chords and 2) groups of notes and the next note (e.g. if order is 3, then “C D E F” would be parsed as “C D E” -> “F”, that is, “C D E” would be grouped as one gesture that is proceeded by “F”).

image

Once the model has been built, the program takes in another chord list, (most likely the same chord list used in the original input), parses it, and probabilistically generates notes to “fill” the chords based on the model we built. The result is a “new” solo over the chords, that has many characteristics of (the same “style” as) the solo that we trained the model on.

image

As part of the class we tested the output of our program on a group of people to determine if they were able to tell the difference between examples of the “real” vs. the generated solos. The result was, not unexpectedly, that they were able to tell the different, and more specifically were more accurate at telling the difference with longer examples than shorter examples. This shows that while our program was somewhat able to reproduce “style” on a small scale, in longer phrases it didn’t have enough “memory” to create musical gestures. Regardless, this system was very interesting to create and resulted in some interesting programming ideas and very strange computer-mediated improvisations.

You can read more in the full report below.