How the Similarity Explorer Works
Understanding temperament relationships through pattern detection and similarity metrics

Overview

The Temperament Similarity Explorer helps you discover how different temperaments relate to each other. It does this by:

Normalization

Before comparing temperaments, the system normalizes them to account for transpositional differences. This means that a temperament starting on C and the same temperament starting on G will be recognized as the same.

Normalization Process

  1. Get 12 offsets (deviations from 12-TET) ordered by pitch class (C, C#, D, ..., B)
  2. Convert to absolute cents positions: base_cents[i] + deviation[i]
  3. Shift so minimum = 0
  4. Wrap to [0, 1200) range
  5. Reorder if needed for smooth chromatic steps

After normalization, two temperaments that differ only by transposition will have identical normalized offsets.

Distance Metrics

The system computes multiple distance metrics to measure similarity. Each metric provides a different perspective:

Euclidean Distance (L2)

Measures the straight-line distance in 12-dimensional space:

√(Σ(offset₁[i] - offset₂[i])²)

Useful for overall similarity - smaller values indicate more similar temperaments.

Manhattan Distance (L1)

Measures the sum of absolute differences:

Σ|offset₁[i] - offset₂[i]|

Less sensitive to large individual differences than Euclidean distance.

Mean Absolute Difference

Average difference across all 12 offsets:

(1/12) × Σ|offset₁[i] - offset₂[i]|

Easy to interpret - represents average cents difference per note.

Maximum Absolute Difference

The largest difference between any corresponding offsets:

max(|offset₁[i] - offset₂[i]|)

Useful for identifying the worst-case difference.

Circular EMD (Earth Mover's Distance)

Accounts for the circular nature of musical intervals. Uses circular distance for each offset pair, where the distance wraps around at 1200 cents.

Pattern Detection: Reverse Engineering Comma Fractions

One of the most powerful features is the ability to detect comma fractions (like 1/4, 1/5, 1/6 comma meantone) by reverse-engineering from the offsets themselves.

The Syntonic Comma

The syntonic comma is the difference between a Pythagorean major third and a just major third. It measures approximately 21.506 cents.

Meantone Temperaments

In meantone temperaments, perfect fifths are narrowed by a fraction of the syntonic comma. For example:

Reverse Engineering Process

To detect the comma fraction from offsets:

  1. Get 12 offsets (deviations from 12-TET)
  2. Convert to absolute cents positions
  3. Compute all 12 fifths: fifth[i] = offset[(i+7) mod 12] - offset[i]
  4. Calculate average deviation from pure fifth (701.955 cents): avg_dev = mean(fifths) - 701.955
  5. If the average is negative (narrowed) and consistent (std dev < 2.5), compute: fraction = 21.506 / |avg_dev|
  6. Round to nearest reasonable fraction (1/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10)
  7. Verify the detected fraction matches within tolerance (±0.5 cents)
Example: If the average fifth deviation is -3.58 cents, then:
21.506 / 3.58 ≈ 6.0
This indicates a 1/6 comma meantone temperament.

Expected Values

Fraction Expected Deviation
1/4-5.38¢
1/5-4.31¢
1/6-3.58¢
1/7-3.07¢
1/8-2.69¢
1/9-2.39¢
1/10-2.15¢

Relationship Explanations

The system explains why two temperaments are found to be similar. It checks for relationships in this priority order:

1. Pattern Match

If both temperaments have the same detected comma fraction (e.g., both are 1/6 comma meantone), this is the primary reason for similarity.

2. Structural Similarity

If both temperaments share the same structural pattern type (e.g., both are "Well Temperament" or "Pythagorean"), this indicates similarity.

3. Transpositional Relationship

If one temperament is a rotation/transposition of another, the system detects this and reports the transposition offset (e.g., "+3 semitones").

4. Offset Pattern Similarity

If the fifth patterns are very similar (average difference < 2 cents), this indicates structural similarity even if patterns don't exactly match.

5. Mathematical Relationship

If one temperament appears to be a scaled variant of another (e.g., all offsets multiplied by a factor), this relationship is detected.

6. General Similarity

If no specific relationship is found, the system reports general similarity based on the distance metrics.

Transposition Detection

After normalization, the system checks if rotating one temperament's offsets produces a better match. It tries all 12 possible rotations and reports the best match if it significantly improves similarity.

This is useful for discovering that two temperaments are the same, just starting on different notes.

Using the Explorer

  1. Select a temperament from the dropdown menu
  2. View pattern detection - See what comma fraction or pattern type is detected
  3. Browse similar temperaments - Results are sorted by similarity (most similar first)
  4. Read relationship explanations - Hover over the explanation to see full details
  5. Sort by different metrics - Click column headers to sort by different distance measures
  6. Filter by pattern match - Temperaments with matching patterns are highlighted in green

Technical Notes