After tinkering with this for a couple of days, I got a version of it running.

It's interesting, and a bit frustrating. The biggest problem is that it's much too easy to over-constrain the sentence, so nothing can be generated.

Another problem is that my version of the program does a really bad job of figuring out what the correct part of speech the template is, and too many words in the dictionary have alternate functions. For example 'A' can be an noun (referring to the letter) or an indefinite article (more common).

Since computers generally follow Murphy's Law, this means that it'll tend to pick the word that fits the constraint, but makes the least amount of sense. This also leads to a lot of repeated words, for reasons that are simply irritating.

Finally, I didn't get around to implementing a "topic" constraint, so my program can't force the noun to be associate with "love" or "anger". So the output is even more random.

I picked the opening of Hotel California as my template:

On a dark desert highway cool wind in my hair
Warm smell of colitas, rising up through the air
Up ahead in the distance, I saw a shimmering light
My head grew heavy and my sight grew dim
I had to stop for the night


The first problem is that colitas isn't in the dictionary, so substitution was called for. Then came the more subtle stuff, like dark desert highway, which is wonderfully alliterative, but has two adjectives in a row - something that wasn't very common in the source material, so there was no possible solution.

To get past this, I finally put the verse itself into the database, which got past that problem. Using a database built with the poems of Edger Allen Poe, I got:

By a dark desert highway
cool wind in all there
passed as but then he dances
by from the air up ahead in her
angel so fair a passionate light
how deep rest looking like strains still is light
we loved so come up the knight


Yep - it fit the constraints, but is still complete gibberish.

From thy dark desert highway cool wind in my hair
warm smell of so all beauty by from the air
so above in her sovereign he where a tremulous light
on air near sober but she said
art sure thou art not be to her flight


Not really any better. This is what Eric Woolfson produced:

From a dark desert highway cool wind in my hair
warm smell of blue all standing on to the air
up ahead in the river i seem a different light
now he is flying so free rain fall
on you can light is through the light


Yep. More gibberish. Fiddling with constraint can bring better results:

Feel a on golden threshold stone shall the sun where
dwell when with many it utters is light in air


Or:

Than the dark desert highway cool wind in an air
have left by our high mountain of blue the air


Constraining it not to reuse rhymes is possible, but I'm not particularly encouraged to keep the project up. The main problem is that the program simply has no understanding. So while you could eventually guide it into generating something useful, you'll never get it to write anything remotely compelling.

It was interesting, but I've got better things to do with my time. smile


-- David Cuny
My virtual singer development blog

Vocal control, you say. Never heard of it. Is that some kind of ProTools thing?