Deep learning for assisting the process of music composition (part 2)

This is part 2 of my explorations of using deep learning for assisting the process of music composition. In this part, I look at some “failures” of a model trained by deep learning methods on over 23,000 folk tunes. Part 1 is here.

Here is a little bit of extended tension composed by the system, which it has titled “Barch Beach”:

I am reminded of the beach scene from “There Will Be Blood.”

The system sometimes composes “sitcom style segues”. For instance, here is a segue perfect for cutting from a festive birthday scene (the system has titled it “The Birthday”) to a tender conversation between two characters that viewers want to see fall in love:

And here is a segue it has titled “The Last Night’s Fanky”, which can cut from said two characters realising what has happened to their humorous admission to the rest of the group what has happened:

These will probably not be favourites to play in a session (although it could be fun to try “Barch Beach”). The same probably goes for the incredible failure that the system has titled, “Le The Chredor”:

T: Le The Chredor
M: 4/4
L: 1/8
K: Gmaj
EGBc BGAG|EAcA C2 BG|DBdB Bcde|fdad bdad|
fBgB fBeB|fBgB adfd|gBag bdbg|eeae (3ggg bg|
|:ecce dBcF|EFGf e2 e/f/g/f/|eBcB AGAB|1^dbcd BGED:|2dfcB A2 zd||
G,2 c,D G,2 G,c,|[A,4D4] [C3:|
[K: Dmaj]
|::|E|"Dm"F2 FD C2 GE|FDFA F4|"C7"ECCE "Dm"FEDF|"Dm"BGFG A2 "A"Ac|
d2 df "Am"eAdc|[dA]fgf e/f/g fe|dBAd/A/ Bcde|A2 "Dm"dc d2 DE:|
|:ECCA _BcBG|F2 AD FAde|fffe f/g/a gf|eccB AGG/G/G|
"Dm"AAFb f2 ef|gdce "G7"dcBA|GEEE {F}EDCE|"F"F2 ^F/G/A FDCD|
|A,CDE F2 Ac|dfed c2 B2|"Bb"AFDF "A7"C3 D| Ec^cd B3 A|
"^Am"AcAF E3 D|"A"A,=FEC A,2 ag|"Dm"fdd(d3-|d)dcd|
f2 fa g2 ab|"D7"agfd "Gm"fedB|"Gm"G2 gf gfdB|"Am"c}"C"Bde (3dcB =A/B/c|
"Dm"f/g/a gf "Em"egag|"Dm"fdef "Gm"d2 de|"Am"fdcd "A7"edBG|1 "Am"D EA^C D2 DA:|2 "Dm"DDDE "Dm"D4|
"Am"A,DEF "C"GECE|"G"D2 A,B, C2 D^C|"Em"D2 GF EDCB,|"Dm"A,2 DF "Dm"A,4:|

I can’t see where in the ABC it says to turn everything up to 11.

Anyhow, I find some of the “failures” of this system very compelling. Take this curious piece the system has composed and titled, “The Castle Star”:

T: Castle Star, The
M: 4/4
L: 1/8
K: Gmaj
d2 de dBGB | e4 d4 | e2 ed d2 B2 | d4 BABd | e2 ed e2 B2 | d2 ed BdBA | GEDE GDBA | G6 :|G3 G G2 GA | B2 Bd efgd | B2 BG A2 GA | BA A2 BGED |G2 G2 G2 GF | EGGE D2 GA | B2 B2 ABcB | AGFG A2 cB ||
| gfgf e2 dg | B2 BA B2 dB | ABAG E2 D2 | GA BA G2 Bd |
efge d2 BG | EGAG A4 | efge dBBd | BABG A2 GE|


That first section sounds oriental because it uses a major pentatonic scale (you can play it on just the black keys of the piano, starting with F#). The first section has a really nice contour in two parts, almost like the first three and a half measures poses a question, and the rest answers it with confidence. The cadence is fun too. The end of the first section is missing a beat from the last measure. The second section consists of a strange rambling line that doesn’t really go anywhere, or have any identifiable musical ideas. It also breaks with the pentatonic scale; but this returns in the third section, which seems a good complement to the A section.

From where did this pentatonic inspiration come? In fact, pentatonic scales are common in Scottish and Irish music. There are tunes within our dataset that stay strictly within a pentatonic scale, such as “The Chinese”:

(The tune is not an Irish tune, but apparently French Canadian.)

The first figure of “The Castle Star” exaclty matches that appearing in the C section of
The Fifth Legion March“, which is almost pentatonic through and through except for the use of the leading tone (F#):

We find no tune in our collection that shares the same two measures as “The Castle Star”, but what about its second measure?

It plays an important role in “Tom Tully’s“:

It appears twice in “Jearoid” (which is also in the same pentatonic scale as “The Castle Star”):

It appears once in “Dragon’s Teeth“:

It starts off the tune of “Michael Coleman’s“:

and the funny reel, “Good morning to your nightcap”:

as well as “Siuil A Ruin“; and it starts off the turn of “Ado Barker’s“:

But it ends “The Weavers’ March” … and wouldn’t you know it! It appears in the “Tibetan National Anthem” which is in our dataset??? (Read the comments.)

So, back to “The Castle Star.” This can be made into a lovely tune. The entire part A is great; but to give it more of a feeling of a human conversation let’s add a few ties to lengthen the notes. Let’s cut section B completely, and make a few adjustments to section C to provide a second part of the conversation begun in section A — but this time with the topic augmented with the leading tone (F#). We also fix the ending, and copy the nice cadence that ends section A but an octave higher. Og voilà!

Synthesized with some appropriate portamento on the violin (to imitate the er-hu, poorly), and adding a sound like a pipa, we have a nice non-Irish tune!

All in all, just a few minor modifications to the output of this model, and we now have a tune that nicely mimics a music style of a completely different part of the world from the West. Now: can I put my name on it as the composer? Or have I merely edited the output of a nameless model?

In the next parts, I will be taking a look at composing things other than folk tunes from the output of the system.

UPDATE: Here I am performing the piece.


4 thoughts on “Deep learning for assisting the process of music composition (part 2)

  1. Pingback: Deep learning for assisting the process of music composition (part 3) | High Noon GMT

  2. Pingback: Deep learning for assisting the process of music composition (part 4) | High Noon GMT

  3. Pingback: Web Picks (week of 24 August 2015) | DataMiningApps

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s