Check The Rhyme: Quantifying Assonance in Rap Lyrics

Iyi Obiechina
7 min readJan 27, 2020

--

A lot of the statistical analysis done on rap lyrics usually deals with words. Although the content and vocabulary of lyrics are interesting features, they are more literal than they are musical. An important musical feature in rap music is rhyme. Alongside rhythm, it is one of the two things that make the often spoken word in rap a musical experience. Rappers often use rhymes to create recognizable patterns and emphasize the rhythm of their lyrics. There are several types of rhymes but this model is focused on just assonance; rhymes involving vowel sounds between words.

When rappers create patterns or rhyme schemes they do so in one or both of two ways; by rhyming words within the bar (internal rhymes) or by rhyming words between the bars (link rhymes). For those of us that aren’t familiar with the term, a bar is a measure used in writing music. Each bar contains the same amount of beats (which for a lot of rap music is four). For the demonstrations in this article, each line of lyrics will represent a bar of the music.

Link Rhymes

Link rhymes in rap music range from the simple to incredibly complex. Take for instance these 2 lines from “That’s the joint” by The Funky Four plus One More:

Jeff is the rhythm and Kay is the bass

Sha-Rock shocking the whole darn place

(Rhyming syllables are displayed using the same font style)

This is a simple case where the two lines are linked by a single rhyming syllable at the end of the bar. Now consider this from, MF DOOM on “One beer”:

Tempt me, do a number on the label

Eat up all they emcees and drink ’em under the table

Here the artiste creates a more complex pattern by rhyming more syllables between the two bars, with 4 syllables (‘tempt’, ‘me’, ‘la-’ and ‘-bel’)on the first line rhyming with another 4 (‘em-’, ‘-cees’, ‘ta-’, ‘-ble’)on the second line. But it can get even more complex, like Jean Grae on “Imagine”:

I define my place as homeostasis

With chromeo bass riffs and homey don’t play this

Here Jean Grae rhymes an incredible 17 syllables, with each rhyming syllable in the first line being linked with at least 2 others in the next line (‘-sis’ is linked with three).

Internal Rhymes

Internal rhymes are used to create patterns within the bar. Here’s a simple example from Nas on “One love”:

Dear Born, you’ll be out soon, stay strong

On this line there is exactly one rhyme ‘Born’ and ‘strong’. Internal rhymes just like link rhymes can be more complex. Here’s a line from Mos Def from “Astronomy(8th light)”:

Blacker than the night time sky of Bed-Stuy in July

The line contains the ‘AY’ sound repeatedly rhymed through the line more than once. In other cases the rapper rhymes different syllables with different sounds on the line. Here’s a line by Black Thought from “Clock with no hands”:

The skies was overcast, when I was sober last

Here there are four distinct syllables each rhymed once across the line.

The Model

The model used here in rhyme detection is inspired by the one used in this paper, which is itself inspired by a technique in bioinformatics used in protein homology detection. A pair of proteins is modeled as sequences of amino acid symbols that are either generated randomly or based on shared ancestry. Using the BLOSUM (BLOcks of amino acid SUbstitution Matrix) local alignment scoring scheme (Henikoff & Henikoff, 1992), the likelihood of a pair of amino acids being matched is assigned log-odd scores. A positive score indicating the pair is likely to co-occur, while a negative score indicates otherwise. In a BLOSUM matrix M, the score for any two amino acid pairs, i and j is calculated as

M[i, j] = In ( Pr[i, j | H] / Pr[i, j | R] )

Where

Pr[i, j | H] is the likelihood of i being matched to j in an alignment of two homologous proteins and,

Pr[i, j | R] is the likelihood of i and j being matched by chance.

Likewise, in a log odds scoring matrix for rhyming syllables M, the score for any two syllable pairs, i and j is calculated as

M[i, j] = In ( Pr[i, j | Rhyme] / Pr[i, j | Random] )

Where the probability of i matching j in the random model is calculated as the product of the frequencies of i and j

Where Fi is the total number of times the sound i appears in the lyrics. While for the rhyming model, the likelihood of i and j being matched as rhymes is calculated as

The table below shows the resulting pairwise scoring matrix for vowel sounds. Each value represents the logarithm of the ratio of the probability of the pair matching in a rhyme versus the pair matching by chance

Quantifying Rhymes

In order to capture link rhymes in verses, the algorithm collects every possible syllable pair between both lines and counts only those positively matched by the scoring matrix. Taking one of the former examples,

Tempt me, do a number on the label

Eat up all they emcees and drink ’em under the table

the ‘EH’ sound in ‘tempt’ will be matched with the first syllable of ‘emcees’ because ‘EH’ according to table gives a positive match of 1.9 when paired with itself, while the ‘IY’ in ‘me’ will be matched positively with both ‘eat’ and the second syllables of ‘emcees’ because the ‘IY’ sound yields a positive score of 2.4 when paired with itself.

In capturing link rhymes, the algorithm collects every possible syllable pair between the line compared against itself, then subtracts the length of the line (number of syllables) from the result before being divided by 2. The internal rhyme I is calculated as

I = (Nm — Ns)/2

Where Nm is the number of positively matched syllables and Ns is the length of the line or number of syllables on the line. The number of matches are subtracted by the length of the line in order to remove non unique matches i.e. matches that come as a result of the two subjects of comparison being exactly the same.

Data and Analysis

I collected 40 rap verses from 40 different rappers each in order to model and test the results. The verses come from albums released between the years 1996 till now. In order to capture the rhymes within those verses, I had to clean them up by hand to deal with inconsistencies such as stylized names (e.g. Da$h) and incorrect spelling. The verses were then transcribed using a combination of the Carnegie Mellon University pronunciation dictionary corpus and an English grapheme to phenome translator, after which they were stripped of all consonant sounds. The results were then processed to extract the following features:

· Link rhymes per syllable

· Internal rhymes per syllable

· Link rhymes per line

· Internal rhymes per line

· Link rhymes per word

· Internal rhymes per word

· Link rhymes per unique word

· Internal rhymes per unique word

Comparison of a median internal and link rhyme per syllable values for a sample of rappers

I hypothesized that the features would show notable differences amongst rappers in terms of both their link and internal rhyming. Having a higher median internal rhyme per syllable would potentially indicate that the rapper typically rhymes more syllables within lines than others, while a higher median link rhyme per syllable would indicate more rhymed syllables between lines. According to the data, Rick Ross and J. Cole rhyme syllables within lines at approximately the same rate (0.75), while the latter typically rhymes more syllables between lines than the former (1.57 to Rick Ross’ 1.48). The values may point to stylistic differences in rappers writing.

A potential problem with the model was the possibility of repeated words increasing the likelihood of matches. To work around that I used both link and internal rhyme per unique word to find out, with link and internal rhyme per word giving it proper context.

Using rhyme per word and rhyme per unique word to detect word repetition in matches

In the first panel of the above figure, Big K.R.I.T in comparison to Rick Ross is shown to execute more internal rhymes per word, but the second panel reveals that Rick Ross rhymes more unique words than Big K.R.I.T does, or matching the same set of words inflates the latter’s rhyme per words in comparison to the former.

Every point or circle represents a rapper, Earl Sweatshirt is singled out in read

According to the data extracted from the model, Earl Sweatshirt has the highest median value on all features amongst the 40 rappers sampled, this would indicate he typically rhymes the most syllables between and within lines amongst those in the sample.

Limitations of The Model

Since the model is only capable of comparing consecutive line pairs, it fails to capture larger rhyme motifs i.e. rhymes between non-consecutive lines.

(Code and data are available here, all visualizations were made on Tableau)

--

--