How Many Musical Scales Are There?

How many musical scales are there? Using combinatorics, this project counts the unique scale rotations possible in the 12-tone system, building on work in music combinatorics by Miller and others.

The idea

A scale can be seen as a pattern of chosen positions among the 12 pitch classes. Rotating a pattern gives its modes. For example, Dorian and Ionian are rotations of the same pattern, while the major scale and harmonic minor scale are genuinely different. The tool counts the truly unique patterns for scales of 0 to 12 notes and identifies known scales among them.

What the code does

  • Generates every permutation of 0–12 notes in 12 positions and tabulates the number of unique rotations.
  • Prints all unique 7-note scales, flags known ones (major, harmonic minor, and others), and renders them as labeled images.
  • Visualizes all possible overlaps between scales of any size.