This week we evaluate the 43 metric candidates with a diagnostic program using a combination of statistics. After considering evidence from correlation runs, we combined that evidence with the musical meaning and implementation of each metric.
The statistical tools we use are Pearson’s correlation and Spearman’s correlation, which correlated each metric with each other metric. If either of those correlations exceeded 0.8, we flagged that pair of metrics for consideration as a candidate for archiving because of high correlation.
As part of our principal-component analysis, we then checked to see how many independent dimensions were needed to explain the 80 percent or more variation represented by the metrics. We also considered skew, extreme value sensitivity, and general distributional behavior because two metrics can be conceptually different, while one might still be a poor statistical representation of its intended musical property.
Finally, we compared related metrics within their musical families and asked which member best represented the concept, whether a normalized version was preferable to a raw count (which one would normally expect), whether two correlated measures still represented musically distinct ideas, and whether symmetry between pitch and rhythm justified retaining a metric.
Thinking About Families
We divided the metrics into seven families. That seems like a lot, but we did not want to force a fit when it wasn’t justified. The seven families are pattern vocabulary and rarity, pitch vocabulary and range, pitch movement and contour, duration and rhythm, rests, pickup-note metrics and tonality.
Pattern Vocabulary and Rarity
Metrics 1, 2, 3, and 4 described overlapping aspects of pattern vocabulary. Metric 2 was a raw count and therefore unduly affected by tune length. Metric 3 normalized the single-occurrence idea proportionally. Metric 4 turned out to be mathematically redundant because M4 = M1 × M3 / 100.
Metrics 8 and 9 (use of common two-note patterns and use of rare two-note patterns) were kept because common-pattern use and rare-pattern use are not simple complements and can distinguish different kinds of vocabulary. Between Metrics 17 and 18 (spread of two-note pattern frequencies, weighted and unweighted, respectively) the occurrence-weighted Metric 17 better represents the sequence actually heard. Furthermore, Metric 18 also overlapped Metric 34, percent of tunes with same individual patterns. We kept Metric 34 because corpus sharing of a tune’s individual patterns is conceptually different from within-tune pattern frequency.
Pitch Vocabulary and Range
Metric 10 measures the range of the pitches in the tune, from the lowest to the highest, while Metrics 23 and 27 concern pitch vocabulary size. Metric 23 was archived because raw distinct-pitch count grows with the opportunities supplied by tune length (that is, it wasn’t normalized by the length of the tune). Metric 27 preserves the vocabulary concept in normalized form. Thus metrics 10 and 27 are retained because range and vocabulary are different musical properties.
Pitch Movement and Contour
Metric 6 was archived because the legacy implementation treated rests coded with a pitch of zero as genuine pitch values, creating artificial jumps. Metrics 12, 13 and 14 all described melodic runs. Metric 13, average run length, was retained as the most stable description of directional persistence, while metric 12 added limited independent information and 14 was sensitive to a single extreme run.
Metric 24 was archived in favor of its normalized counterpart, Metric 28. Metric 31, repeated intervals, measured a persistence of durations that was already represented more broadly by retained movement metrics. Metric 33 survived because a three-note palindrome (identical first and third pitches) captures a specific return contour. Metric 39, average duration run length, was added and retained because upward-versus-downward direction is not supplied by the other metrics on movement magnitude or run length.
Duration and Rhythm
Metric 11, average duration ratio, was archived because the arithmetic mean of raw duration ratios is directionally asymmetric and skewed. Metric 35 (absolute average duration change) gives a cleaner magnitude-of-change measure, and Metric 40 (increasing duration changes) separately captures direction, and were both added.
Raw duration-vocabulary Metrics 25 and 26 were ultimately archived in favor of normalized representations. Between normalized Metrics 29 and 30, Metric 30 was kept because duration ratios capture relationships between successive rhythmic events and supplied the more useful measure of transitions in vocabulary. Metric 32 overlapped strongly with the simpler repeated-duration signal in Metric 15, and was therefore archived.
The new duration-run family (metrics 36, 37, and 38) were added because a mirror set of pitch Metrics 12, 13, and14 was missing. After comparison, Metric 37, average duration-run length, was retained, while metrics 36 and 38 (number of duration ratios per note and maximum duration run length, respectively) were both archived.
Rests
Metric 5, number of rests per note, measures how prevalent rests are. Metrics 21 and 22 measure duration ratios going into and coming out of rests. The fact that a rest may be coded with pitch zero is irrelevant because these metrics use duration, not pitch. Both were therefore kept. Their behavior may be especially interesting because substantial rests occur in very different musical traditions, including some rock, Renaissance and polyphonic music.
Pickup Metrics
We had high hopes for metrics 19 and 20, pickup-note duration and pickup-note pitch, because it seemed a clean measurable for how to begin a tune. Unfortunately, because we divide some tunes into different melodic sections before entering them in the database, a transition between one section and another may include a meaningless pickup note that’s impossible to distinguish from the real thing. It should be possible to eventually add structural context, but the payoff is questionable for the effort. Thus, we archived both 19 and 20.
Tonality
We added Metrics 41, 42, and 43 specifically because tonality was the major conceptual family missing from the entire set of metrics. Diatonic pitch percentage, tonic emphasis and pitch-class entropy describe different aspects of tonal organization. All three survived the selection process.
Archived
Here’s a table summarizing all archived metrics. Note that they are archived for the purpose of cluster analysis only, and may be brought back into play in the future for another purpose:
Archived Metrics
| # | Archived metric | Principal reason |
|---|---|---|
| 2 | Number of Single-occurrence Patterns in Tune | Raw count; tune-length dependence |
| 4 | Single-occurrence Patterns As Percent of Notes | Mathematically determined by Metrics 1 and 3 |
| 6 | Absolute Pitch Change Average | Legacy rest-as-pitch-zero contamination |
| 11 | Average Duration Ratio | Ratio asymmetry/skew; cleaner magnitude and direction measures retained |
| 12 | Number of Runs Per Note | Limited independent information once average run persistence is retained |
| 14 | Max Run Length | Extreme-value version of the run concept |
| 18 | Spread of Two-Note Pattern Frequencies, Unweighted | Weighted version is more representative; additional overlap with Metric 34 |
| 19 | Pick-up Duration | Pickup identity is context-dependent after structural splitting |
| 20 | Pick-up Percent | Same contextual pickup problem |
| 23 | Number of Different Pitches | Raw length-dependent version of pitch vocabulary |
| 24 | Number of Different Pitch Differentials | Raw length-dependent version of interval vocabulary |
| 25 | Number of Different Durations | Raw length-dependent duration vocabulary |
| 26 | Number of Different Duration Ratios | Raw length-dependent transition vocabulary |
| 29 | Normalized Number of Durations | Strong overlap with Metric 30; 30 better captures relational rhythmic vocabulary |
| 31 | Number of Repeated Intervals | Narrow/redundant pitch-persistence measure |
| 32 | Number of Repeated Duration Ratios | Strong overlap with duration repetition |
| 36 | Number of Duration Runs per Note | Redundant within duration persistence/change family |
| 38 | Maximum Duration Run Length | Extreme-value version of Metric 37 |
Cluster Analysis Metrics
Here is a table of all the metrics retained for the cluster analysis:
| # | Metric | Family |
|---|---|---|
| 1 | Number of Patterns Within a Tune As Percent of Notes | Pattern vocabulary / rarity |
| 3 | Single-occurrence Patterns As Percent of Tune Patterns | Pattern vocabulary / rarity |
| 5 | Number of Rests per Note | Rests |
| 7 | Relative Pitch Change Average | Pitch movement / contour |
| 8 | Use of Common Patterns | Pattern vocabulary / rarity |
| 9 | Use of Rare Patterns | Pattern vocabulary / rarity |
| 10 | Range of Pitches | Pitch vocabulary / range |
| 13 | Average Run Length | Pitch movement / contour |
| 15 | Repetitive Note Durations | Rhythm / duration |
| 16 | Repetitive Note Pitches | Repeated pitch |
| 17 | Spread of Two-Note Pattern Frequencies, Weighted | Pattern vocabulary / rarity |
| 21 | Average Duration Ratio Going to Rests | Rhythm / duration |
| 22 | Average Duration Ratio Coming from Rests | Rhythm / duration |
| 27 | Normalized Number of Different Pitches | Pitch vocabulary / range |
| 28 | Normalized Number of Pitch Differentials | Pitch movement / contour |
| 30 | Normalized Number of Duration Ratios | Rhythm / duration |
| 33 | Percent of 3-Note Palindromes | Pitch movement / contour |
| 34 | Percent of Tunes with Same Individual Patterns | Pattern vocabulary / rarity |
| 35 | Absolute Average Duration Change | Rhythm / duration |
| 37 | Average Duration Run Length | Rhythm / duration |
| 39 | Ascending Pitch Changes | Pitch movement / contour |
| 40 | Increasing Duration Changes | Rhythm / duration |
| 41 | Diatonic Pitch Percentage | Tonality |
| 42 | Tonic Emphasis | Tonality |
| 43 | Pitch-Class Entropy | Tonality |
The diagnostic process tells us that these 25 metrics are the most likely to succeed in a cluster analysis of the tunes without labels. But they are not the only metrics capable of describing music. We constructed them to feature vocabulary for this experiment, broad enough to represent pattern use, pitch vocabulary, contour, repetition, rests, rhythm and tonality, while avoiding obvious duplication and known implementation defects.
The final set of metrics contains only four strongly correlated pairs among the 25 active metrics, and our principal component analysis required 11 principal components to reach 80 percent cumulative variance. That is useful evidence that the retained variables do not collapse into only two or three underlying measurements. It also means that a respectable amount of independent structure remains.
This completes the metric-selection process and we now have a set of musical characteristics worth measuring. It does not yet answer whether all 25 should receive equal weight when we cluster the tunes. That is the next stage of the analysis and the topic of next week’s blog.