One of the patents granted to Skiptune LLC by the U.S. Patent Office involves the use of metrics to compare tunes or melodies. We introduced the idea of comparing melodies in the section on Chernoff Faces, which use human faces to compare tunes and genres with each other. That technique, while both useful and entertaining, is highly subjective, depending as it does on our individual ability to discern human faces, as well as the somewhat arbitrary way of assigning metrics to face parts. Here, we use the metrics we developed to describe tunes or melodies to compare them with each other. The concept is simple: calculate each metric for each tune, sum the metrics for each tune, and subtract the two sums to find the difference. The closer the difference is to zero, the more likely the two tunes will be similar.
To demonstrate how the metrics can be used to compare tunes, we use as our example a dancing tune from the 17th century called Devil’s Dream, found in the 1657 and 1670 versions of the Dancing Master, compiled by John Playford. Here are the two tunes:


These tunes are almost, but not quite, identical. The only differences between the two melodies are in the second and sixth measures. In each of those measures, the change is the same: The “C#” half note and the “D” quarter note switch places. Table 1, following, lists how our music metrics describe each tune numerically.
Table 1 — Comparing Two Versions of ‘Devil’s Dreams’
| Metric Number | Name of Metric | Raw Metric, 1670 version | Normalized Metric, 1670 version | Raw Metric, 1657 version | Normalized Metric, 1657 version | Difference (Normalized) |
|---|---|---|---|---|---|---|
| 0 | Patterns/Note (%) | 39 | 0.407 | 39 | 0.407 | 0 |
| 1 | # One-Time Patterns | 4 | 0.042 | 4 | 0.042 | 0 |
| 2 | One-Time Patterns/Tune Patterns (%) | 31 | 0.31 | 31 | 0.31 | 0 |
| 3 | One-Time Patterns/Note (%) | 12 | 0.13 | 12 | 0.13 | 0 |
| 4 | # Rests/Note | 0 | 0 | 0 | 0 | 0 |
| 5 | Avg Pitch Diff w/Rests | 1.7 | 0.02 | 1.7 | 0.02 | 0 |
| 6 | Avg Pitch Diff w/o Rests | 1.7 | 0.12 | 1.7 | 0.12 | 0 |
| 7 | Common Patterns (%) | 1.9 | 0.23 | 1.9 | 0.23 | 0 |
| 9 | Range | 10 | 0.15 | 10 | .015 | 0 |
| 10 | Avg Duration Ratio | 1.4 | 0.1 | 1.4 | 0.1 | 0 |
| 11 | # Runs/Note (%) | 64 | 0.64 | 64 | 0.64 | 0 |
| 12 | Run Length/Note | 1.43 | 0.11 | 1.43 | 0.11 | 0 |
| 13 | Max Run Length | 4 | 0.13 | 4 | 0.13 | 0 |
| 14 | # Repeating Durations | 18 | 0.18 | 18 | 0.18 | 0 |
| 15 | # Repeating Pitches | 6 | 0.06 | 6 | 0.06 | 0 |
| 16 | Spread of Pattern Frequencies (Wtd) | 2.9 | 0.6 | 2.9 | 0.6 | 0 |
| 17 | Spread of Pattern Frequencies (Un-Wtd) | 3.3 | 0.68 | 3.3 | 0.68 | 0 |
| 18 | Pick-Up Note Duration | 0 | 0 | 0 | 0 | 0 |
| 19 | Pick-Up Note Duration (%) | 0 | 0 | 0 | 0 | 0 |
| 20 | Duration Ratio to Rests | 0 | 0 | 0 | 0 | 0 |
| 21 | Duration Ratio from Rests | 0 | 0 | 0 | 0 | 0 |
| 22 | # Different Pitches | 7 | 0.1 | 7 | 0.1 | 0 |
| 23 | # Different Pitch Differentials | 6 | 0.14 | 6 | 0.14 | 0 |
| 24 | # Different Durations | 6 | 0.19 | 6 | 0.19 | 0 |
| 25 | # Different Duration Ratios | 8 | 0.1 | 8 | 0.1 | 0 |
| 26 | Normalized # Different Pitches | 21 | 0.23 | 21 | 0.23 | 0 |
| 27 | Normalized # Different Intervals | 18 | 0.25 | 18 | 0.25 | 0 |
| 28 | Normalized # Durations | 18 | 0.28 | 18 | 0.28 | 0 |
| 29 | Normalized # Duration Ratios | 24 | 0.33 | 24 | 0.33 | 0 |
| 30 | # Repeated Pitch Diff (%) | 0 | 0 | 0 | 0 | 0 |
| 31 | # Repeated DurR (%) | 6 | 0.06 | 6 | 0.06 | 0 |
| 32 | 3-Note Palindromes (%) | 30 | 0.37 | 24 | 0.3 | 0.07 |
| TOTAL | 0.07 |
NOTE: Metrics #8 and #33 are missing because they do not apply to individual tunes. The only difference in any of the metrics between the two tunes is the number of 3-note palindromes, metric #32 in the table. This is somewhat surprising because one would expect that any change in notes between two otherwise identical tunes would produce a larger difference in the metrics. But on inspection we find that these tunes really have identical 2-note patterns differing primarily in their order. This feature results in almost identical metrics. Following are some examples explaining this phenomenon in these two melodies:
- Patterns per note: There are 13 patterns in each tune. Examine the swapped notes in the second and seventh measure and you will see that in each case the order of the patterns are changed, but not the patterns themselves.
- Number of one-time patterns, one-time patterns per tune, and one-time patterns per note: Because only the order of the 2-note patterns changes, the number of each kind of pattern remains the same. And because each tune is the same length, the normalized pattern metrics remains the same.
- Intervals (pitch differences) and common patterns: Because the patterns themselves are the same in each tune, both the interval metrics and the percent of common patterns used are also the same.
- Range metrics: The changes in measures 2 and 7 do not affect the range because while they involve the highest note (a “D”), they don’t change it to another pitch.
Observation— When the primary or only difference between two tunes is the order of their 2-note patterns, most of the metrics will be the same because many metrics depend on the count of individual patterns.
- Average duration ratio: Because only the order of patterns changes, the duration ratios themselves do not change.
- Run metrics: The changes in measures 2 and 7 do not affect the number of runs or their average length, and are not involved in the maximum run (measure 4).
- Repeating pitches and durations: This particular difference in tunes, because of the particular notes that precede and follow the changed notes, keep the number of repeating pitches and durations the same.
- The order change of the patterns does not affect their spread (standard deviation).
- Number of different pitches, durations, intervals, duration ratios, and the normalized versions of these metrics: The changed order of the patterns leaves these counts intact between the tunes. The tunes contain the same number of notes, so the normalized versions are also the same.
- Repeated intervals (pitch differentials) and repeated duration ratios: The changes in measures 2 and 7 do not involve the notes that either repeat intervals or repeat duration ratios.
Musical Palindromes
We now turn to the single difference between the two tunes as far as our metrics are concerned: palindromes. There are eight 3-note palindromes in the 1657 version of “Devil’s Dreams” and 10 palindromes in the 1670 version. (The palindromes are easy to count as they are all either a D quarter-C# half-D quarter note or C# half-D quarter-C# half note.) This difference in palindrome count results in the palindrome metric having a difference between the two tunes of 0.07.
This page introduced and explained in detail how the Skiptune metrics can be used to assess the similarities between tunes in an analytic, numerical manner. Other pages on this topic provide more examples but without the detail of marching through each metric.