Now that we have a basic understanding about entropy in music, we finish off the pre-training discussion of rests by focusing on how they affect duration ratios in the database. It turns out that rests inform us about the rhythmic structure of the tunes in the corpus.
Let’s look at the concentration of ratios in their distribution. We start with the summary statistics:
- Total note-to-note transitions: 4.8 million
- Unique duration ratios: 411
- Ratio of 1 occurs 59 percent of the time
- Ratios 2 and 1/2 ad another 20 percent
- Ratios 3 and 1/3 add another 10 percent
- Entropy: 2.351 bits
That means just five ratios (1, 2, 1/2, 3, and 1/3) account for 89 percent of every duration transition in the 4.8 million observations. That’s a highly concentrated distribution
What this tells us about melodic music, at least as it’s represented in the Skiptune database, is that the rhythmic language of melody is highly conservative. When composers move from one note to the next they overwhelmingly do one of three things:
- Keep the same duration
- Double the duration
- Halve the duration
Everything else is relatively rare. The corpus contains music from folk songs, nursery songs, hymns, classical works, marches, show tunes, popular songs, dance tunes, and art music, yet they all seem to share essentially the same rhythmic grammar. While we haven’t tested this numerically, it is obvious that if 9 in 10 duration ratios are in a small set, that is going to be true for subcategories of the dataset as well, with some small variation.
We can conclude that the rhythm vocabulary is therefore much smaller than the pitch vocabulary.
Now let’s turn to the entropy value of the Skiptune database, which is about 2.35 bits. We spent last week explaining entropy in music because of all the statistics we’ve cited on durations, entropy is perhaps the most important because it means rhythmic prediction is much easier than pitch prediction. Any AI model will learn duration behavior quickly relative to pitch behavior, and we know that from the relatively low entropy of the durations in the database.
To put the 2.35 bits of entropy into human perspective, we calculate a new metric called “perplexity”. Perplexity is the number 2 raised to the power of entropy, which in this case results in about 5. The metric is called “perplexity” because if an AI model is guessing the next word, it must choose from a set of words, each associated with a probability of being correct. In our case, it means the model is choosing a duration ratio from a set of 5 most likely duration ratios. The model is “perplexed” over which one of the five to choose.
Although there are over 400 duration ratios in the Skiptune database, by the time the model has to predict the next note, the options to choose from are down to just 5. That means rhythmic transitions in the Skiptune corpus are highly predictable, despite the existence of hundreds of distinct duration ratios.
Decision on Rest Inclusion
Our analysis leads us to conclude that it would be preferable to include rests in the training of our AI model when the time comes. While some rests are directed to the performing artist (it’s okay to take a breath here), some are there for effect, and those instances are often marked by different genres. For instance, rock music has longer internal rests than the pop music that preceded it. Thus, rests provide clues that can help create more authentic sounding melodies. Even the performative rests have value in that they make the melodies sound more accessible to performers. They also break up phrasing that might otherwise be missed.
Having decided to include rests in the AI training of the initial model, we will keep on the table the following test: After creating the model based on rests, use that same architecture and run it on the database where the rests’ durations have been absorbed into the previous note. Then compare the two outputs and listen for differences in melodic quality, rest-related pathologies, and phrasing.
This concludes the discussion on rests. Next week we’ll turn to another pre-training topic: Pitch differentials.