A Study of Scales
Where we discuss every possible combination of notes
Assumptions
This exploration of scales is based in a musical universe founded on two assumptions:

Octave Equivalence
We assume that for the purpose of defining a scale, a pitch is functionally equivalent to another pitch separated by an octave. So it follows that if you're playing a scale in one octave, if you continue the pattern into the next octave you will play pitches with the same name. 
12 tone equal temperament
We're using the 12 tones of an equallytempered tuning system, as you'd find on a piano. Equal temperament asserts that the perceptual (or functional) relationship between two pitches is the same as the relationship between two other pitches with the same chromatic interval distance. Other tuning systems have the notion of scales, but they're not being considered in this study.
Representing a scale
When I began piano lessons as a child, I learned that a scale was made up of whole and halfsteps. The scale was essentially a stack of intervals piled up, that happened to add up to an octave. While this view of the scale is useful for understanding diatonic melodies, it's not a convenient paradigm for analysis. Instead, we should regard a scale as being a set of 12 possibilities, and each one is either on or off.
The major scale, in lights.
What we have in the 12tone system is a binary "word" made of 12 bits. We can assign one bit to each degree of the chromatic scale, and use the power of binary arithmetic and logic to do some pretty awesome analysis with them. When represented as bits it reads from right to left  the lowest bit is the root, and each bit going from right to left ascends by one semitone.
The total number of possible combinations of on and off bits is called the "power set". The number of sets in a power set of size n is (2^n). Using a word of 12 bits, the power set (2^12) is equal to 4096. The fun thing about binary power sets is that we can produce every possible combination, by merely invoking the integers from 0 (no tones) to 4095 (all 12 tones).
This means that every possible combination of tones in the 12tone set can be represented by a number between 0 and 4095. We don't need to remember the fancy names like "phrygian", we can just call it scale number 1451. Convenient!
$allscales = range(0, 4095);
decimal  binary  

0  000000000000  no notes in the scale 
1  000000000001  just the root tone 
1365  010101010101  whole tone scale 
2741  101010110101  major scale 
4095  111111111111  chromatic scale 
An important concept here is that any set of tones can be represented by a number. This number is not "ordinal"  it's not merely describing the position of the set in an indexed scheme; it's also not "cardinal" because it's not describing an amount of something. This is a nominal number because the number *is* the scale. You can do binary arithmetic with it, and you are adding and subtracting scales with no need to convert the scale into some other representation.
Scale Finder
Not sure what scale you've got? Check the boxes below tones that appear in your scale. Then follow the link to learn more about it!
Because scales are cyclical  they repeat and continue beyond a single octave  it is intuitive to represent them in "bracelet" notation. This visual representation is useful because it helps conceptualize modes and rotation (which we'll get into further below).
Here is the major scale, represented as a bracelet. Black beads are on bits, white beads are off bits.
If you imagine the bracelet with clock numbers, the topmost bead  at 12 o'clock  is the root, or 1st degree of the scale. Beware that in some of the math, this is the "0" position, as if we're counting semitones above the root. To play a scale ascending, start from the top and move around it clockwise. To play the scale descending, start at 12 o'clock and go around counterclockwise.
Interval Pattern
Another popular way of representing a scale is by its interval pattern. When I was learning the major scale, I was taught to say aloud: "tone, tone, semitone, tone, tone, tone, semitone". Many music theorists like to represent a scale this way because it's accurate and easy to understand: "TTSTTTS". Having a scale's interval pattern has merit as an intermediary step can make some kinds of analysis simpler. Expressed numerically  which is more convenient for computation  the major scale is [2,2,1,2,2,2,1].
Pitch Class Sets
Yet another way to represent a scale is as a "pitch class set", where the tones are assigned numbers 0 to 11 (sometimes using "T" and "E" for 10 and 11), and the set enumerates the ones present in the scale. A pitch class set for the major scale is notated like this: {0,2,4,5,7,9,11}. The "scales" we'll study here are a subset of Pitch Classes (ie those that have a root, and obey Zeitler's Rules^{1}) and we can use many of the same mathematical tricks to manipulate them.
What is a scale?
Or more importantly, what is *not* a scale?
Now that we have the superset of all possible sets of tones, we can whittle it down to exclude ones that we don't consider to be a legitimate "scale". We can do this with just two rules.

A scale starts on the root tone.
This means any set of notes that doesn't have that first bit turned on is not eligible to be called a scale. This cuts our power set in exactly half, leaving 2048 sets.
In binary, it's easy to see that the first bit is on or off. In decimal, you can easily tell this by whether the number is odd or even. All even numbers have the first bit off; therefore all scales are represented by an odd number.
We could have cut some corners in our discussion of scales by omitting the root tone (always assumed to be on) to work with 11 bits instead of 12, but there are compelling reasons for keeping the 12bit number for our scales, such as simplifying the analysis of symmetry, simplifying the calculation of modes, and performing analysis of sonorities that do not include the root, where an even number is appropriate.
function hasRootTone($scale) { // returns true if the first bit is not a zero return (1 & $scale) != 0; } $allscales = array_filter($allscales, 'hasRootTone');
scales remaining: 2048

A scale does not have any leaps greater than n semitones.
For the purposes of this exercise we are saying n = 4, a.k.a. a major third. Any collection of tones that has an interval greater than a major third is not considered a "scale". This configuration is consistent with Zeitler's constant used to generate his comprehensive list of scales.
function doesNotHaveFourConsecutiveOffBits($scale) { $c = 0; for ($i=0; $i<12; $i++) { if (!($scale & (1 << ($i)))) { $c++; if ($c >= 4) { return false; } } else { $c = 0; } } return true; } $allscales = array_filter($allscales, 'doesNotHaveFourConsecutiveOffBits');
scales remaining: 1490
Now that we've whittled our set of tones to only the ones we'd call a "scale", let's count how many there are with each number of tones.
function countOnBits($scale) {
$c = 0;
for ($i=0; $i<12; $i++) {
if ($scale & (1 << ($i))) {
$c++;
}
}
return $c;
}
number of tones  how many scales 

1  0 
2  0 
3  1 
4  31 
5  155 
6  336 
7  413 
8  322 
9  165 
10  55 
11  11 
12  1 
Heptatonics
The equal temperament system of 12 tones has a special affinity for heptatonic scales. Of the 1490 scales, 413 of them are heptatonic, comprising 28% of the total. The predominant scales used in popular music are heptatonic, including those derived most closely from the circle of fifths.
Some heptatonics are diatonic. To be diatonic means that it includes only notes in the prevailing key; so the set of diatonic scales are very limited to just the major scale and its 6 modes  and only when used in a context where the modes are offset in respect to the tonic key.
Hepatonia prima, secunda, tertia
(coming soon)
Symmetry
There are two kinds of symmetry of interest to scale analysis. They are rotational symmetry and reflective symmetry.
Rotational Symmetry
Rotational symmetry is the symmetry that occurs by transposing a scale up or down by an interval, and observing whether the transposition and the original have an identical pattern of steps.
The set of 12 tones has 5 axes of symmetry. The twelve can be divided by 1, 2, 3, 4, and 6.
Any scale containing this kind of symmetry can reproduce its own tones by transposition, and is also called a "mode of limited transposition" (Messaien)
function symmetries($scale) {
$rotateme = $scale;
$symmetries = array();
for ($i = 0; $i < 12; $i++) {
$rotateme = rotate_bitmask($rotateme);
if ($rotateme == $scale) {
$symmetries[] = $i;
}
}
return $symmetries;
}
Below are all the scales that have rotational symmetry.
axes of symmetry  interval of repetition  scales 

1,2,3,4,5,6,7,8,9,10,11  semitone  
2,4,6,8,10  whole tone  
3,6,9  minor thirds  
4,8  major thirds  
6  tritones 
number of notes in scale  Placement of rotational symmetries  

1  2  3  4  5  6  7  8  9  10  11  
3  0  0  0  1  0  0  0  1  0  0  0  
4  0  0  1  0  0  3  0  0  1  0  0  
5  0  0  0  0  0  0  0  0  0  0  0  
6  0  1  0  3  0  10  0  3  0  1  0  
7  0  0  0  0  0  0  0  0  0  0  0  
8  0  0  2  0  0  10  0  0  2  0  0  
9  0  0  0  3  0  0  0  3  0  0  0  
10  0  0  0  0  0  5  0  0  0  0  0  
11  0  0  0  0  0  0  0  0  0  0  0  
12  1  1  1  1  1  1  1  1  1  1  1 
A curious numeric pattern
You'll notice that in the list of scales exhibiting rotational symmetry, many have a decimal representation that ends with the digit 5. A closer look shows that the pattern exists for all scales that have symmetry on axes of 6, 4, and 2  where all the notes in the scale are in pairs a tritone apart. In the binary schema, each pair of notes that are a tritone apart add up to a multiple of 10, except for the root pair that adds up to 65. Therefore, all scales with rotational symmetry on the tritone will end with the digit 5.
1 + 64
= 65
2 + 128
= 130
4 + 256
= 260
8 + 512
= 520
16 + 1024
= 1040
32 + 2048
= 2080
Messiaen's Modes  and their truncations
The French composer Olivier Messiaen studied scales with rotational symmetry, because they are useful in creating sonorities with an ambiguous tonic. He famously named seven such modes, and asserted that they are the only ones that may exist; all other symmetrical scales are truncations of those. We can prove that Messiaen was correct, by putting every symmetrical scale into a chart of their truncation relationships.
In all of Messiaen's modes, the modes are regarded as identical, which makes sense because the whole point was to create ambiguous tonality. Therefore when we speak of one of the Messiaenic modes, we're talking about a whole modal family of scales, like this one which he labeled Mode 7:
Truncation is the process of removing notes from a scale, without affecting its symmetry. The concept is best explained by example. Let's take the mode which Messiaen called the Second Mode:
That scale is symmetrical along the axis of a 3semitone interval, i.e. by transposing it up a minor third. When we remove tones to create a truncation, we must preserve that symmetry, by removing four notes from the scale, like this:
In addition to the 3semitone symmetry, that scale is also symmetrical along the axis of a 6semitone interval. We can create two different truncations of 1755 that preserve that symmetry:
Technically, all of Messiaen's modes are truncated forms of 4095 , the 12tone scale, which is symmetrical at all intervals.
Hierarchy of truncations
This diagram illustrates that all symmetrical scales are truncations of the Messaienic modes (labeled "M" plus their number as assigned by Messaien). M1, M2, M3, and M7 are all truncations of the chromatic scale 4095; M2, M4, and M6 are truncations of M7; M1 and M5 are truncaions of M6. M1 is also a truncation of M3, and M5 is also a truncation of M4. All the other rotationally symmetrical scales are labeled "T#" and are shown where they belong in the hierarchy of truncations.
Modal Family  Scales  is truncation of 

*  
Messiaen's Modes of Limited Transposition  
M1  *, M3, M6  
M2  *, M7  
M3  *  
M4  M7  
M5  M6, M4  
M6  M7  
M7  *  
Truncations  
T1  M2, T5, T4  
T2  M3  
T3  M1, T2  
T4  M2, M6, M4  
T5  M2, M6, M4  
T6  T4, T5, M5, M1 
 In this study we are ignoring sonorities that aren't like a "scale" by disallowing large interval leaps (see the first section). If we ignore those rules, what other truncated sets exist? (spoiler hint: not very many!)
 Does the naming of certain scales by Messiaen seem haphazard? Why did he name M5, which is merely a truncation of both M6 and M4, which are in turn truncations of M7?
Reflective Symmetry
A scale can be said to have reflective symmetry if it has the same interval pattern whether ascending or descending. A reflectively symmetrical scale, symmetrical on the axis of the root tone, is called a palindromic scale.
function isPalindromic($scale) {
for ($i=1; $i<=5; $i++) {
if ( (bool)($scale & (1 << $i)) !== (bool)($scale & (1 << (12  $i))) ) {
return false;
}
}
return true;
}
Here are all the scales that are palindromic:
Chirality
An object is chiral if it is distinguishable from its mirror image, and can't be transformed into its mirror image by rotation. Chirality is an important concept in knot theory, and also has applications in molecular chemistry.
The concept of chirality is apparent when you consider "handedness" of a shape, such as a glove. A pair of gloves has a left hand and a right hand, and you can't transform a left glove into a right one by flipping it over or rotating it. The glove, therefore, is a chiral object. Conversely, a sock can be worn by the right or left foot; the mirror image of a sock would still be the same sock. Therefore a sock is not a chiral object.
Palindromic scales are achiral. But not all nonpalindromic scales are chiral. For example, consider the scales 1105 and 325 (below). One is the mirror image (reflection) of the other. They are not palindromic scales. They are also achiral, because one can transform into the other by rotation.
The major scale is achiral. If you reflect the major scale, you get the phrygian scale; these two scales are modes (rotations) of each other. Therefore neither of them are chiral. Similarly, none of the other ecclesiastical major modes are chiral.
What makes chirality interesting? For one thing chirality indicates that a scale does not have any symmetry along any axis. If you examine all achiral scales, they will all have some axis of reflective symmetry  it's just not necessarily the root tone (which would make it palindromic).
function isChiral($scale) {
$reflected = reflect_bitmask($scale);
for ($i = 0; $i < 12; $i++) {
$reflected = rotate_bitmask($reflected, 1, 1);
if ($reflected == $scale) {
return false;
}
}
return true;
}
A chiral object and its mirror image are called enantiomorphs. (source)
function enantiomorph($scale) {
$scale = reflect_bitmask($scale);
$scale = rotate_bitmask($scale, 1, 1);
return $scale;
}
Scale  Name  Chirality / Enantiomorph 

273 (Augmented Triad)  Augmented Triad  achiral 
585 (Diminished Seventh)  Diminished Seventh  achiral 
661 (Major Pentatonic)  Major Pentatonic  achiral 
859 (Ultralocrian)  Ultralocrian  2905 (Aeolian flat 1) 
1193 (Minor Pentatonic)  Minor Pentatonic  achiral 
1257 (Blues scale)  Blues scale  741 
1365 (Wholetone)  Wholetone  achiral 
1371 (Superlocrian)  Superlocrian  achiral 
1387 (Locrian)  Locrian  achiral 
1389 (Minor Locrian)  Minor Locrian  achiral 
1397 (Major Locrian)  Major Locrian  achiral 
1451 (Phrygian)  Phrygian  achiral 
1453 (Aeolian)  Aeolian  achiral 
1459 (Phrygian Dominant)  Phrygian Dominant  2485 (Harmonic Major) 
1485 (Minor Romani)  Minor Romani  1653 (Minor Romani inverse) 
1493 (Lydian Minor)  Lydian Minor  achiral 
1499 (Bebop Locrian)  Bebop Locrian  2933 
1621 (Prometheus (Scriabin))  Prometheus (Scriabin)  1357 (Takemitsu Tree Line mode 2) 
1643 (Locrian natural 6)  Locrian natural 6  2765 (Lydian Diminished) 
1709 (Dorian)  Dorian  achiral 
1717 (Mixolydian)  Mixolydian  achiral 
1725 (Minor Bebop)  Minor Bebop  achiral 
1741 (Altered Dorian)  Altered Dorian  1645 (Dorian flat 5) 
1749 (Acoustic)  Acoustic  achiral 
1753 (Hungarian Major)  Hungarian Major  877 (Moravian Pistalkova) 
1755 (Octatonic)  Octatonic  achiral 
2257 (Lydian Pentatonic)  Lydian Pentatonic  355 
2275 (Messiaen Mode 5)  Messiaen Mode 5  achiral 
2457 (Major Augmented)  Major Augmented  achiral 
2475 (Neapolitan Minor)  Neapolitan Minor  2739 (Mela Suryakanta) 
2477 (Harmonic Minor)  Harmonic Minor  1715 (Harmonic Minor inverse) 
2483 (Double Harmonic)  Double Harmonic  achiral 
2509 (Double Harmonic Minor)  Double Harmonic Minor  achiral 
2535 (Messiaen mode 4)  Messiaen mode 4  achiral 
2731 (Neapolitan Major)  Neapolitan Major  achiral 
2733 (Melodic Minor ascending)  Melodic Minor ascending  achiral 
2741 (Major)  Major  achiral 
2773 (Lydian)  Lydian  achiral 
2777 (Aeolian Harmonic)  Aeolian Harmonic  875 (Locrian Doubleflat 7) 
2869 (Ionian Augmented)  Ionian Augmented  1435 (Makam Huzzam) 
2901 (Lydian Augmented)  Lydian Augmented  achiral 
2925 (Diminished)  Diminished  achiral 
2989 (Bebop Minor)  Bebop Minor  1723 (JG Octatonic) 
2997 (Major Bebop)  Major Bebop  achiral 
3055 (Messiaen mode 7)  Messiaen mode 7  achiral 
3411 (Enigmatic)  Enigmatic  2391 
3445 (Messiaen mode 6 inverse)  Messiaen mode 6 inverse  achiral 
3549 (Messiaen mode 3 inverse)  Messiaen mode 3 inverse  achiral 
3765 (Dominant Bebop)  Dominant Bebop  achiral 
4095 (Chromatic)  Chromatic  achiral 
 Reflective symmetry can occur with an axis on other notes of the scale. Are those interesting?
 The reflection axis can be on a tone, or between two tones. Is that interesting?
 Is there a more optimal or elegant way to find the reflective symmetry axes of a scale?
 Are there chiral enantiomorph pairs that are both named scales?
Combined Symmetry
Using similar methods to those above, we can identify all the scales that are both palindromic and have rotational symmetry. Here they are:
Balance
We assert a scale is "balanced", if the distribution of tones arranged around a 12spoke wheel would balance on its centre. This is related to the wellknown problem in mathematics known as the "balanced centrifuge problem".
There are 47 balanced scales. Here they are:
Interval Spectrum / Richness / Interval Vector
Howard Hanson, in the book "Harmonic Materials"^{2}, posits that the character of a sonority is defined by the intervals that are within it. This definition is also called an "Interval Vector"^{3} or "Interval Class Vector" in Pitch Class Set theory. Furthermore, in his system an interval is equivalent to its inverse, i.e. the sonority of a perfect 5th is the same as the perfect 4th. Hanson categorizes all intervals as being one of six classes, and gives each a letter: p m n s d t, ordered from most consonant (p) to most dissonant (t). When an interval appears more than once in a sonority, it is superscripted with a number, like p^{2}.
P  the Perfects (5 or 7)
This is the interval of a perfect 5th, or perfect 4th.
M  The Major Third (4 or 8)
This is the interval of a major 3rd, or minor 6th
N  The Minor Third (3 or 9)
This is the interval of a minor 3rd, or a major 6th
S  the second (2 or 10)
This is the interval of a major 2nd, or minor 7th
D  the Diminished (1 or 11)
Intervals of a minor 2nd, or a major 7th
T  the Tritone (6 semitones)
For example, in Hanson's analysis, a C major triad has the sonority pmn, because it contains one perfect 5th between the C and G (p), a major third between C and E (m), and a minor third between the E and G (n). Interesting to note that a minor triad of ACE is also a pmn sonority, just with the arrangement of the minor and major intervals swapped. The diminished seventh chord 585 has the sonority n^{4}t^{2} because it contains four different minor thirds, and two tritones.
We can count the appearances of an interval using a method called "cyclic autocorrelation". To find out how many of interval X appear in a scale, we rotate a copy of the scale by X degrees, and then count the number of positions where an "on" bit appears in both the original and copy.
function find_spectrum($scale) {
$spectrum = array();
$rotateme = $scale;
for ($i=0; $i<6; $i++) {
$rotateme = rotate_bitmask($rotateme, $direction = 1, $amount = 1);
$spectrum[$i] = countOnBits($scale & $rotateme);
}
// special rule: if there is a tritone in the sonority, it will show up twice, so we divide by 2
$spectrum[5] = $spectrum[5] / 2;
return $spectrum;
}
All members of the same modal family will have the same interval spectrum, because the spectrum doesn't care about rotation, and modes are merely rotations of each other. And there will be many examples of different families that have the same interval spectrum  for example, 281 and 275 both have the spectrum "pm^{3}nd", but they are not modes of each other.
Below is a table of some of the named scales, and their interval spectrum. You'll notice that modal families will all have the same spectrum; hence every named mode of the diatonic scale (lydian, dorian, phrygian etc.) has the same spectrum of p^{6}m^{3}n^{4}s^{5}d^{2}t
273 (Augmented Triad)  m^{3} 
585 (Diminished Seventh)  n^{4}t^{2} 
661 (Major Pentatonic)  p^{4}mn^{2}s^{3} 
859 (Ultralocrian)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1193 (Minor Pentatonic)  p^{4}mn^{2}s^{3} 
1257 (Blues scale)  p^{4}m^{2}n^{3}s^{3}d^{2}t 
1365 (Wholetone)  m^{6}s^{6}t^{3} 
1371 (Superlocrian)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
1387 (Locrian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1389 (Minor Locrian)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
1397 (Major Locrian)  p^{2}m^{6}n^{2}s^{6}d^{2}t^{3} 
1451 (Phrygian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1453 (Aeolian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1459 (Phrygian Dominant)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1485 (Minor Romani)  p^{4}m^{5}n^{3}s^{4}d^{3}t^{2} 
1493 (Lydian Minor)  p^{2}m^{6}n^{2}s^{6}d^{2}t^{3} 
1499 (Bebop Locrian)  p^{5}m^{5}n^{6}s^{5}d^{4}t^{3} 
1621 (Prometheus (Scriabin))  p^{2}m^{4}n^{2}s^{4}dt^{2} 
1643 (Locrian natural 6)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1709 (Dorian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1717 (Mixolydian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1725 (Minor Bebop)  p^{7}m^{4}n^{5}s^{6}d^{4}t^{2} 
1741 (Altered Dorian)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1749 (Acoustic)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
1753 (Hungarian Major)  p^{3}m^{3}n^{6}s^{3}d^{3}t^{3} 
1755 (Octatonic)  p^{4}m^{4}n^{8}s^{4}d^{4}t^{4} 
2257 (Lydian Pentatonic)  p^{3}m^{2}nsd^{2}t 
2275 (Messiaen Mode 5)  p^{4}m^{2}s^{2}d^{4}t^{3} 
2457 (Major Augmented)  p^{3}m^{6}n^{3}d^{3} 
2475 (Neapolitan Minor)  p^{4}m^{5}n^{3}s^{4}d^{3}t^{2} 
2477 (Harmonic Minor)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
2483 (Double Harmonic)  p^{4}m^{5}n^{4}s^{2}d^{4}t^{2} 
2509 (Double Harmonic Minor)  p^{4}m^{5}n^{4}s^{2}d^{4}t^{2} 
2535 (Messiaen mode 4)  p^{6}m^{4}n^{4}s^{4}d^{6}t^{4} 
2731 (Neapolitan Major)  p^{2}m^{6}n^{2}s^{6}d^{2}t^{3} 
2733 (Melodic Minor ascending)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
2741 (Major)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
2773 (Lydian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
2777 (Aeolian Harmonic)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
2869 (Ionian Augmented)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
2901 (Lydian Augmented)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
2925 (Diminished)  p^{4}m^{4}n^{8}s^{4}d^{4}t^{4} 
2989 (Bebop Minor)  p^{5}m^{5}n^{6}s^{5}d^{4}t^{3} 
2997 (Major Bebop)  p^{6}m^{5}n^{6}s^{5}d^{4}t^{2} 
3055 (Messiaen mode 7)  p^{8}m^{8}n^{8}s^{8}d^{8}t^{5} 
3411 (Enigmatic)  p^{4}m^{4}n^{3}s^{5}d^{3}t^{2} 
3445 (Messiaen mode 6 inverse)  p^{4}m^{6}n^{4}s^{6}d^{4}t^{4} 
3549 (Messiaen mode 3 inverse)  p^{6}m^{9}n^{6}s^{6}d^{6}t^{3} 
3765 (Dominant Bebop)  p^{7}m^{4}n^{5}s^{6}d^{4}t^{2} 
4095 (Chromatic)  p^{12}m^{12}n^{12}s^{12}d^{12}t^{6} 
 Is there an optimal or elegant way to find all scales with a given spectrum?
 What patterns appear in interval distribution?
 Which are the most common, and least common spectra?
Evenness
Another interesting property of a scale is whether the notes are evenly spaced, or clumped together. The theory of musical scale evenness owes to "Diatonic Set Theory", the work of Richard Krantz and Jack Douhett^{4}. In their paper, they explain how you can determine the "evenness" of a scale, first by establishing the intervals between each note and every other.
To measure the evenness of the scale, the first step is to build the distribution spectra. The spectra shows the distinct specific intervals between notes, for each generic interval of the scale. Each spectrum is notated like this:
<generic interval> = { specific interval, specific interval, ...}
The number in angle brackets is the generic interval, ie we are asking "for notes that are this many steps away in the scale". The numbers in curly brackets are the specific intervals we find present for those steps, ie "between those steps we find notes that are this many semitones apart".
It's best explained with an example. Below is the scale bracelet diagram and distribution spectra for Scale 1449:
Scale  Notes  Distribution Spectra 

<1> = {1,2,3} <2> = {3,4,5} <3> = {5,7} <4> = {7,8,9} <5> = {9,10,11} 
In line 1, the first spectrum, <1> indicates that we are looking at notes that are one scale step away from each other. We have notes that are one semitone apart (eg G and G#), two semitones (D# and F), and three semitones (C and D#). Duplicates of these are ignored; we merely want to know what intervals are present, not how many of them exist.
In line 2, the second spectrum, <2> indicates that we are looking at notes that are two scale steps away from each other. We see pairs that are three semitones apart (eg F and G#), four semitones (D# and G), and five semitones (C and F).
When there is more than one specific interval, the spectrum width is the difference between the largest and smallest value. For example for the <3> spectrum above, the specific intervals are {5,7} and so its width is 2, which is 7 minus 5.
The spectrum variation is the average of all those widths.
Once the distribution specta are built, we analyze them to discover interesting properties of the scale. For instance,
 If all the spectra have just one specific interval, then the scale has exactly equal distribution
 If the spectra have two intervals with a difference no greater than one, then the scale is maximally even  it's distributed as evenly as it can be with no room for improvement.
 If the spectra has any widths greater than 1, then it's not maximally even.
 If there are exactly two specific intervals in all the spectra, then the scale is said to have Myhill's property.
Ultimately, the measure of a scale's evenness is its Spectra Variation. We add up all the spectrum widths, and divide by the number of tones in the scale, to achieve an average width with respect to the scale size. If a scale has perfectly spaced notes with completely uniform evenness, then it has a spectra variation of zero. A higher variation means the scale distribution is less even.
The following four scales have a perfect score  a spectra variation of zero:
Obviously, it is possible to evenly distribute 6 tones around a 12tone scale. But it is impossible to do that with a 5 tone (pentatonic) or 7 tone (heptatonic) scale. For such tone counts all we can hope to achieve is an optimally even distribution.
Below are all the prime scales (ie with rotations omitted), sorted from most even to least even. If you click to each scale detail page, you can read its spectra variation there.
3 tones
4 tones
5 tones
6 tones
7 tones
8 tones
9 tones
10 tones
11 tones
12 tones
Myhill's Property
Myhill's Property is the quality of a pitch class set where the spectrum has exactly two specific intervals for every generic interval. There are 47 scales with Myhill's property:
Propriety / Coherence
A scale is said to have "Rothenberg propriety", a quality named after David Rothenberg^{5}, if the scale has unambiguous relationship between generic intervals (scale degrees) and specific intervals. The same concept was discovered by Gerald Balzano, who named it coherence.
To be proper (aka coherent), every twostep generic interval must be specifically larger than every onestep generic interval, every threestep generic interval must be specifically larger than every twostep, and so on. This means that when hearing any interval from within a scale, you can unambiguously know what generic distance it is within the scale.
You can see the coherence of a scale by inspecting its distribution spectra. Look at this scale:
Scale  Notes  Distribution Spectra 

<1> = {1,2,3} <2> = {3,4,5} <3> = {5,7} <4> = {7,8,9} <5> = {9,10,11} 
You can see that if you hear an interval of 2 semitones, that is unambiguously a onestep generic distance. We know this because the specific distance of 2 appears in the spectra only in the 1step spectrum.
Contrarily, if we know that our scale is 1449 rooted on C, and we hear an interval of 5 semitones (a perfect fourth), this could be a generic distance of a two steps (between C and F), or it might be a generic distance of three steps (between D# and G#). That ambiguity means this scale is not coherent.
There are exactly 31 coherent scales. Here they are:
Deep Scales
A "deep" scale is one for which the evenness distribution spectrum of specific intervals consists of unique values. There are only 13 deep scales. Here they are:
Hemitonia and Tritonia
One interesting approach to understanding scales is to look at the distribution of consonant and dissonant intervals in the scale. We did this already in the "spectrum analysis" above, but two intervals in particular are commonly regarded in more depth: tritones and semitones  which are deemed the most dissonant of intervals, and those that give a scale its spice and flavour.
A scale that contains semitones is called "hemitonic", and we will also refer to a hemitonic as the scale member that has the upper semitone neighbour (for example, mifa and tido in a major scale, the hemitones are mi and fa).
A scale that contains tritones is called "tritonic", and we will also refer to a tritonic as the scale member that has a tritone above it. This concept seems very close to the notion of "imperfection" (explained below)
Since hemitonia and tritonia are based on the interval spectrum, all the modes of a scale will have the same hemitonia. For example, the major scale is dihemitonic and ancohemitonic; thus so are dorian, phrygian, lydian, etc.
Number of tones  # of Hemitonic Scales  # of Tritonic Scales 

3  0  0 
4  12  24 
5  140  150 
6  335  335 
7  413  413 
8  322  322 
9  165  165 
10  55  55 
11  11  11 
12  1  1 
It's well to know that so many scales are hemitonic and tritonic (having more than zero semitones or tritones), but obviously some scales are more hemitonic than others. A scale could have no hemitonics ("ahemitonic"), one ("unihemitonic"), two ("dihemitonic"), three ("trihemitonic") and so on. Let's look at the count of hemitones in our scales.
Number of hemitones  

tones in scale  0  1  2  3  4  5  6  7  8  9  10  11  12 
3  1  0  0  0  0  0  0  0  0  0  0  0  0 
4  19  12  0  0  0  0  0  0  0  0  0  0  0 
5  15  80  60  0  0  0  0  0  0  0  0  0  0 
6  1  30  150  140  15  0  0  0  0  0  0  0  0 
7  0  0  21  140  210  42  0  0  0  0  0  0  0 
8  0  0  0  0  70  168  84  0  0  0  0  0  0 
9  0  0  0  0  0  0  84  72  9  0  0  0  0 
10  0  0  0  0  0  0  0  0  45  10  0  0  0 
11  0  0  0  0  0  0  0  0  0  0  11  0  0 
12  0  0  0  0  0  0  0  0  0  0  0  0  1 
Fun fact: there are no scales with 11 hemitones. Do you understand why?
Number of tritones  

tones in scale  0  1  2  3  4  5  6  7  8  9  10  11  12 
3  1  0  0  0  0  0  0  0  0  0  0  0  0 
4  7  16  8  0  0  0  0  0  0  0  0  0  0 
5  5  40  75  30  5  0  0  0  0  0  0  0  0 
6  1  12  102  146  69  6  0  0  0  0  0  0  0 
7  0  0  14  112  196  84  7  0  0  0  0  0  0 
8  0  0  0  0  62  168  84  8  0  0  0  0  0 
9  0  0  0  0  0  0  84  72  9  0  0  0  0 
10  0  0  0  0  0  0  0  0  45  10  0  0  0 
11  0  0  0  0  0  0  0  0  0  0  11  0  0 
12  0  0  0  0  0  0  0  0  0  0  0  0  1 
Cohemitonia
Cohemitonia is the presense of two semitones consecutively in scale order. For instance, if a scale has three cromatically consecutive notes, then it is cohemitonic. We will also refer to the cehemitonic as the tone that has two semitone neighbours above it.
Heliotonia
A scale is heliotonic if it is heptatonic (has seven tones), and if it can be represented on a staff with a note head on each line and space, using no more than a fulltone alteration accidental (sharp, flat, doublesharp, doubleflat).
Since this property is affected by the uneven interval distance between what we call "the white notes" (ie steps that are not altered with an accidental), heliotonia is dependent on the root. A scale that is heliotonic in C might not be when the root is F#.
Of the 413 heptatonic scales, 363 of them are heliotonic when the root is C.
At present, insufficient research has been done to correlate heliotonia with other properties such as evenness, cohemitonia, etc. It has also not been sufficiently investigated how the stats of heliotonia change for each root tone. As such, heliotonia is a subject with opportunities for further exploration.
Here are all the scales that are heliotonic, when C is the root: