Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a known algorithm to identify lyrics and music with matching meters? [closed]

It is sometimes possible to interchange different tunes and lyrics. For example:

  • Any parody song will be new lyrics that fit the original tune; see most of Weird Al's songs
  • Hymns in Christian churches frequently have several tunes that can fit the same lyrics

Although in theory any words could be sung to any tune, most combinations would be extremely awkward. A human with a good sense of meter can easily identify good or bad matches. A program should be able to do this, also.

For example, imagine the following lines from "The Star Spangled Banner":

Oh say, can you see by the dawn's early light 
what so proudly we hailed at the twilight's last gleaming?

The following parody lyrics (which I just made up) work for the tune because they have the same meter:

Oh say, can you see if my keister's on fire?
I suspect I was duped when I bought warming trousers

Whereas the following lyrics, which have a different and inconsistent meter, would be a very poor fit for the tune:

If you liked it then you shoulda put a ring on it
Don't be mad when you see that he want it

Is there a known algorithm to identify lyrics and music with matching meters?

like image 416
Nathan Long Avatar asked Mar 12 '12 12:03

Nathan Long


1 Answers

This is actually a problem I looked at many years ago for my final year degree project. There's a similar phenomenon in old english folk songs -- there were a large collection of 'Broadside Ballads' that usually had written at the top 'To be sung to the tune of Packington's Pound' (or some other well known tune). This is how the news was distributed, by ballad singers, singing in public places. As a result there were many sets of words for a small number of tunes. In my project I looked at creating an algorithm to analyse a verse of text and find the tune in a database to which it could be sung.

At that time I couldn't find any previous research that answered this question. It didn't even have a name, so we dubbed it 'Contrafactal Analysis' (I understood that 'contrafacture' means 'to sing words to a different tune').

The method I employed did an initial grammatical analysis phase using the Computer Usable Version of the Oxford Advanced Learner's Dictionary (CUVOALD) (which is very old now, but you may find if you google around). This tells you the part of speech (eg verb, noun) of each word, and also where the primary word stress lies. That is important since generally the primary word stress coincides with the beat. An analysis of a number of examples showed that it was most common that nouns and verbs were stressed on beats, so in your example:

Oh say, can you see by the dawn's ear-ly light

Trying to impose this stress pattern on your counterexample would be:

If you liked it then you should-a put a ring on it

which just sounds totally wrong. In prosody terms, I think this is a dactylic stress pattern: (de)-DER-de-de DER-de-de DER-de-de DER.

So if you can produce a sentence that has that same prosodic structure then chances are you can sing it to the original tune

Hi George can you stand there by Greg-or-y's bike

In practice you can also insert extra syllables here and there as long as the main stresses occur in the same place. I implemented some code to do this in ML.

That should give you a bit of background to the problem. I'll try to find the report I wrote on it and will update here.

UPDATE: I've finally managed to convert the ancient WordPerfect file to a pdf

like image 193
the_mandrill Avatar answered Sep 19 '22 13:09

the_mandrill