Let’s stack consecutive fifths from note D in both directions: 3 fifths upwards and 3 fifths downwards. We will have the D dorian scale. One more step of a fifth in each direction yields F# and B♭. With this notes instead of F and B we have the melodic D major and melodic G minor.
Next step upwards yields C# and the harmonic D major, while a step downwards would give us E♭ and the phrygian dominant mode of the harmonic G minor.
Both these steps (notes C# and E♭ instead of C and E) yield double harmonic major scale on D and double harmonic minor scale on G.
All these scales feature symmetry around the center D. The harmonic major and phrygian dominant mode of the harmonic minor are the exception: they are symmetric one with another (the ascending pattern of intervals of one repeats the descending pattern of the other).
Each symmetric scale has a mode for each of its individual scale degrees.
This method shows correlation between the place of a scale or a mode in the circle of fifths and its degree of relation to the first diatonic scale in this system – D dorian scale.
So we have:
1. D – tonic
2. A, G – dominant and subdominant
3. D, A, G, E, C – pentatonic scale
4. Next two notes (F and B) yield a seven-note diatonic scale.
5. Then in order to produce diatonic scales we will use alterations instead of adding new notes. We will get melodic, harmonic and double harmonic scales.
6. Then next alterations will yield a six-note scale D, E♭, F#, G#, B♭, C#.
7. Next double step yields D# and D♭ instead of D and yield pentatonic scale G#, B♭, C#, E♭, F# – five black keys of the keyboard. This new pentatonic scale and the first pentatonic scale are a tritone apart.
The order of the alterations is the reversed order of adding new notes.
Tonic, dominant and subdominant were the first notes that appeared in this process and the last notes that were altered. This stability illustrates their meaning in the key.
Notes F and B were the last notes that appeared in the process of adding new notes and immediately were altered. They are the most unstable notes in D dorian. In blues, for example, D dorian with F may sound over D mixolydian with F#.