Cluster Analysis–Part 3

—

by

in

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 metricPrincipal reason
2Number of Single-occurrence Patterns in TuneRaw count; tune-length dependence
4Single-occurrence Patterns As Percent of NotesMathematically determined by Metrics 1 and 3
6Absolute Pitch Change AverageLegacy rest-as-pitch-zero contamination
11Average Duration RatioRatio asymmetry/skew; cleaner magnitude and direction measures retained
12Number of Runs Per NoteLimited independent information once average run persistence is retained
14Max Run LengthExtreme-value version of the run concept
18Spread of Two-Note Pattern Frequencies, UnweightedWeighted version is more representative; additional overlap with Metric 34
19Pick-up DurationPickup identity is context-dependent after structural splitting
20Pick-up PercentSame contextual pickup problem
23Number of Different PitchesRaw length-dependent version of pitch vocabulary
24Number of Different Pitch DifferentialsRaw length-dependent version of interval vocabulary
25Number of Different DurationsRaw length-dependent duration vocabulary
26Number of Different Duration RatiosRaw length-dependent transition vocabulary
29Normalized Number of DurationsStrong overlap with Metric 30; 30 better captures relational rhythmic vocabulary
31Number of Repeated IntervalsNarrow/redundant pitch-persistence measure
32Number of Repeated Duration RatiosStrong overlap with duration repetition
36Number of Duration Runs per NoteRedundant within duration persistence/change family
38Maximum Duration Run LengthExtreme-value version of Metric 37

Cluster Analysis Metrics

Here is a table of all the metrics retained for the cluster analysis:

#MetricFamily
1Number of Patterns Within a Tune As Percent of NotesPattern vocabulary / rarity
3Single-occurrence Patterns As Percent of Tune PatternsPattern vocabulary / rarity
5Number of Rests per NoteRests
7Relative Pitch Change AveragePitch movement / contour
8Use of Common PatternsPattern vocabulary / rarity
9Use of Rare PatternsPattern vocabulary / rarity
10Range of PitchesPitch vocabulary / range
13Average Run LengthPitch movement / contour
15Repetitive Note DurationsRhythm / duration
16Repetitive Note PitchesRepeated pitch
17Spread of Two-Note Pattern Frequencies, WeightedPattern vocabulary / rarity
21Average Duration Ratio Going to RestsRhythm / duration
22Average Duration Ratio Coming from RestsRhythm / duration
27Normalized Number of Different PitchesPitch vocabulary / range
28Normalized Number of Pitch DifferentialsPitch movement / contour
30Normalized Number of Duration RatiosRhythm / duration
33Percent of 3-Note PalindromesPitch movement / contour
34Percent of Tunes with Same Individual PatternsPattern vocabulary / rarity
35Absolute Average Duration ChangeRhythm / duration
37Average Duration Run LengthRhythm / duration
39Ascending Pitch ChangesPitch movement / contour
40Increasing Duration ChangesRhythm / duration
41Diatonic Pitch PercentageTonality
42Tonic EmphasisTonality
43Pitch-Class EntropyTonality

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.