This week we control the cluster analysis for tune length to determine if that feature affected the analysis in a way that needs to be accounted for. We controlled for length by moving from the original analysis that produced clusters with very different median lengths (62, 30, and 41 sounded notes) to a 32 – 64-note experiment, of which the medians are 43, 46, and 45 sounded notes.
The bottom line of the controlled analysis is that the large length differences have essentially disappeared, yet the algorithm still divides the melodies into three substantial groups or clusters.
Here’s a table summarizing the results compared to the original, uncontrolled cluster analysis:
| Measure | Original analysis | Length-controlled |
| Melodies | 83,581 | 41,424 |
| Cluster 1 | 45.9% | 43.2% |
| Cluster 2 | 31.2% | 32.8% |
| Cluster 3 | 22.9% | 24.0% |
| Median length, C1 | 62 | 43 |
| Median length, C2 | 30 | 46 |
| Median length, C3 | 41 | 45 |
| First two PCA components | 38.5% | 40.2% |
The new run retains all 25 metrics, the seven-family weighting system, the original preprocessing strategy, and ten k-means initializations. It also recalculates the scaling parameters on the restricted sample.
The controlled-length Principal Component Analysis (PCA) picture shows three recognizable regions, rather than one undifferentiated cloud. But the amount of overlap, particularly near the center, means we should not regard these as three sharply separated natural classes. Here’s the picture of the controlled experiment clusters:

The PCA plot shows a blue upper region, green lower-right region, and purple left region, with substantial overlap near the origin. The plot explains about 40 percent of the weighted variance in its first two principal components, compared with 39 percent in the original run.
The three regions are visibly organized, but the PCA projection is not an independent validation of the clustering. Both the PCA and k-means use the same 25 metrics. Some visual separation is therefore expected.
Moreover, approximately 60 percent of the weighted variance lies outside these two plotted dimensions. We cannot determine the quality of separation in the full 25-dimensional space from this picture alone.
Melody Length No Longer Defines Groups
The length-controlled experiment removes the most obvious reason to suspect that the algorithm was simply separating long, medium, and short tunes. However, there is a qualification: Restricting length does not prove that length has ceased to influence every metric. For example, vocabulary diversity and pattern recurrence can still vary systematically between 32-note and 64-note melodies. Nevertheless, the residual length differences among the new clusters are comparatively small.
Unstable Clusters?
We matched the 41,424 melodies in the experimental run to their assignments in the original full-corpus analysis, using their tune IDs. Here is the transition table:
| Original cluster | New C1 | New C2 | New C3 | Total |
| Original C1 | 8,527 | 9,746 | 657 | 18,930 |
| Original C2 | 8,372 | 2,809 | 16 | 11,197 |
| Original C3 | 992 | 1,043 | 9,262 | 11,297 |
Each row shows where melodies from an original cluster ended up after re-clustering within the restricted length range imposed by the experiment. We see that the original Cluster 3 pretty much stayed in the new Cluster 3. However, the original Cluster 1 was dispersed more to new Cluster 2 than to new Cluster 1. Even worse was original Cluster 2, which dispersed mostly to new Cluster 1.
We can conclude that the original Cluster 3 is pretty stable because 82 percent of those tunes remained in the new Cluster 3 in the experiment. The other two original clusters are much less stable. Original Cluster 1 divides almost evenly between new Clusters 1 and 2. Original Cluster 2 sends roughly three-quarters of its eligible melodies into new Cluster 1.
Which Distinctions Survive
Several musical characteristics remain different across the new clusters, despite their nearly identical lengths. Here are selected metrics from the results:
| Musical metric | New C1 | New C2 | New C3 |
| Repeated pitches (%) | 9.5 | 9.1 | 31.7 |
| Repeated durations (%) | 41.4 | 60.6 | 46.6 |
| Pitch-class entropy (%) | 76.3 | 74.2 | 65.4 |
| Pitch range (semitones) | 16.1 | 15.7 | 12.1 |
| Average absolute duration change | 0.7 | 0.5 | 0.6 |
| Rests per note (%) | 6.8 | 0.7 | 5.6 |
| Tonic emphasis (%) | 17.1 | 18.7 | 21.4 |
The values in the table are raw cluster means. These results support three provisional structural interpretations:
- New Cluster 1: Melodically varied, rhythmically differentiated melodies. This cluster has relatively high pitch-class entropy, substantial pitch range, greater average duration changes, and more rests. It also has the highest use of rare patterns among the three groups. These features suggest melodic and rhythmic differentiation rather than a strongly repetitive structure.
- New Cluster 3: Rhythmically repetitive, relatively continuous melodies. The defining characteristic is its 60.6 percent repeated-duration rate, substantially exceeding the other two clusters. It also has exceptionally few rests, a relatively low average duration change, and greater use of common melodic patterns. This looks like a coherent rhythmic organization rather than merely a length effect.
- New Cluster 3: Pitch-repetitive, tonally concentrated melodies. This is the most robust structural family. Approximately 31.7 percent of adjacent sounded-note transitions repeat the pitch, versus about 9 percent in the other clusters. It also has the narrowest pitch range, lowest pitch-class entropy, and highest tonic emphasis. These are essentially the same distinctive characteristics that defined original Cluster 3, and presents strong evidence that this particular structural type is not an artifact of tune length.
Assessment after Length Control
To summarize what we learned from the length-controlled experiment:
- Strengthened: That Skiptune melodies exhibit measurable structural diversity beyond length
- Partially Supported: The original three clusters represent stable musical structural types
- Weakened: The original cluster assignments are robust after controlling for length
The change worth noting concerns the original division between Clusters 1 and 2. The original Cluster 1 was characterized by long melodies and rhythmic repetition, while Cluster 2 contained shorter melodies with more varied patterns and durations. Once length was restricted, that division reorganized considerably.
The fact that the original Cluster 3 survives almost intact suggests that one of the original structural distinctions was particularly robust, while the other two were more sensitive to the length distribution of the corpus.
This does not mean that the original three-cluster analysis was invalid. It accurately describes a partition of the full corpus under the chosen metrics and preprocessing. But it now appears less defensible to interpret all three original groups as equally stable, length-independent musical families.
Next Steps
The next and final step is to compare the cluster analysis with Skiptune’s genre labels to see what correlates, if anything.