Thoughts of a geek

8 September 2009

An idea for songfighting

Filed under: Computers, music — Tags: , , , , , — qwandor @ 11:14 pm

I was walking to work yesterday, and I had an idea.

Perhaps you have heard of SONG FIGHT. If not, the idea is fairly simple: each week, a song title is given. Competitors then have a week to write the words and music for a song fitting that title, record it, and submit it. Anyone can then download the songs, listen to them and vote for which they think are best. I guess the main point is to motivate musicians to write more songs, to improve their skills and whatnot.

Anyway, my idea is to automate the process. I want to write some software that, given a title, can produce a half-plausible sounding song matching it. The first step would be to generate the lyrics, which I guess could be handled by an approach based on Markov chains trained on a range of existing song lyrics, probably combined with some sort of syllable and rhyming dictionaries to produce lines with some sort of rhythmic structure. Hmm, perhaps the rhythm should be generated first and then the lyrics made to fit it. The title would be included in one of the lines, probably near the beginning or end, or even several times in the chorus.

Next (or perhaps first), it would be necessary to generate some sort of plausible tune for the verse and chorus, and any other bits in-between (bridge? intro? instrumental bit in the middle?). I am not sure how to approach this, perhaps there is some literature on the subject. Maybe more Markov chains, or some sort of recombination of existing tunes, or some other method. I could really do with some advice from musicians here: how do you put together a tune that actually sounds tuneful, rather than just a list of random notes?

I assume that once the basic melody is generated, generating a passable accompaniment would be relatively straightforward, though again I will need to talk to some musicians.

Once the music and lyrics are sorted, along with an arrangement for the song, producing the final product would be a matter of running the lyrics and melody through Festival’s singing mode (as I have played with before), synthesise a few instruments and some drums for the rest of it, and mix it all together, ready to submit. Simple?

Anyway, reactions? Does this sound plausible? Has it all been done before? Can you offer any advice, especially for the musical side of it?



  1. Personally I think it’d be very VERY difficult, but if anyone can do it, you can.

    One step in the process that you’ve left out (I think) would be getting the program to recognise certain words in the title (or perhaps in the entire lyric) and then pick a musical style based on the emotions those words are associated with. Is it an angry song? Perhaps a song that uses the word “together” or “unity” would have a tendency to sound anthemic. These would influence both the tune and arrangement of the song. If it’s a very standard love song, maybe it’s in 6/8 timing. This step needs to go between generating the lyrics and generating the tune and arrangement.

    Comment by tommo39 — 9 September 2009 @ 1:03 am

  2. I think this is a reasonable thing to try.

    There are certainly only a handful of tricks that usually show up in pop songs. If you randomly produce a chord sequence (even just a random word from I, IV, V, VIm of a given key would sound tolerable, but would quickly get boring), it should be quite possible to produce a melody over that chord structure, keeping in mind that the first note sung over any chord is often a note in the chord, et cetera.

    You would need some mechanism to keep a unity to the tune, for example between the verse and the chorus — a bank of “ideas” already used throughout the song that you can hark back to.

    Josh’s mood problem is certainly a problem, but if you’re trying to produce something that will pass the Turing Test, you might as well stop now :D.

    Oh, and Josh: do take a look at songfight if you haven’t already. It has a pretty daunting culture, but the people are crazy cool.

    Comment by J'Bosh — 9 September 2009 @ 9:11 am

  3. You might want to incorporate a database of known chord sequences that work. If there are not too many.

    As for the mood of the song, I think it would be highly amusing to set the title “Together we walk in unity” to the melody of a love song. In fact mismatches like this could be among the best outputs of the process.

    Comment by fibby — 9 September 2009 @ 10:00 am

RSS feed for comments on this post. TrackBack URI

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

Create a free website or blog at

%d bloggers like this: