Is there a known algorithm for identifying texts and music using appropriate counters?

Sometimes you can change different melodies and lyrics. For example:

  • Any parody of the song will be new lyrics that match the original melody; see most songs of Weird Al.
  • Anthems in Christian churches often have several tunes that can match the same lyrics.

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

For example, imagine the following lines from Star Shine:

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

The following parody songs (which I just composed) work for the melody because they have the same counter:

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

While the following lyrics, which have a different and inconsistent meter, would be very bad for a melody:

 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 well-known algorithm for determining lyrics and music with corresponding meters?

+7
source share
2 answers

This is actually a problem that I looked many years ago for my project at the end of the year. There was a similar phenomenon in old English folk songs - there was a large Broadside Ballad collection, which was usually written at the top of "To Sing to the Packington Pound" (or some other famous tune). So the news was distributed, ballads, sang in public places. As a result, there were many sets of words for a small number of tunes. In my project, I considered creating an algorithm for analyzing a verse of text and finding a melody in a database that you could sing into.

At that time, I could not find any previous studies that would answer this question. He didn’t even have a name, so we called him "Contrafactal Analysis" (I understood that "contrafacture" means "to sing words to another melody").

The method I used performed the initial phase of grammar analysis using the computer version of the Oxford Advanced Learning Dictionary (CUVOALD) (which is now very old, but you can find if you use Google). This tells you about the part of speech (for example, the verb, noun) of each word, as well as where the main stress stress lies. This is important, because in general, the primary phrase coincides with the rhythm. The analysis of a number of examples showed that the most common nouns and verbs with bits, so in your example:

Oh tell me if you can see the light with the dawn of the ear

Trying to impose this picture of stress on your counterexample will be:

If you liked it , then you should a place a ring on it

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

So, if you can create a sentence that has the same prosodic structure, then there is a chance that you can sing it to the original melody

Hi George , can you stand there Greg -or-y bike

In practice, you can also insert additional syllables here and there, while the main stresses occur in the same place. I have executed some code to do this in ML.

This should give you some information about the problem. I will try to find the report that I wrote on it, and will be updated here.

UPDATE: I finally managed to convert an ancient WordPerfect file to pdf

+8
source

In python, you can use the Natural Language ToolKit (NLTK) to get the pronunciation of a word, and then analyze the stress from it. Here is a simple example that is paraphrasing (paracoding?) Of one in nltkbook:

 import nltk words = nltk.corpus.cmudict.entries() pronunciation_dict = {} for word, prons in words: pronunciation_dict[word] = prons string = "what so proudly we hailed at the twilight last gleaming?" print "".join(["".join([char for char in "".join(pronunciation_dict[word]) if char.isdigit()]) for word in string.split()]) 

multiple words may have different stress patterns, depending on usage. The above method will simply take the first specified pronunciation.

The results for your lines will be (with a bit of editing to make sure that only the words in the dictionary are used):

"Oh tell me, you can see the early light at dawn 11011101101

that with pride we welcomed the last brilliance at dusk? "1110111012110

check nltk.book at https://sites.google.com/site/naturallanguagetoolkit/book

a more complex version of the example I gave is given in chapter 2

+3
source

All Articles