One of the more interesting scales in western music theory is the Melodic Minor Scale. Composers who were unhappy with the plainness of the natural minor scale, yet concerned about the augmented step between the minor sixth and major seventh, developed the melodic minor scale to add some spice to their compositions without making performance too difficult.
The scale is dynamic. Depending on the direction of the melody, the scale either contains major sixths and sevenths or minor sixths and sevenths.
The A melodic minor scale ascends and descends as follows:
A B C D E F# G# A G F E D C B A
The general formula for the scale in any key is:
Ascending - 1 2 b3 4 5 6 7
Descending - b7 b6 5 4 b3 2 1
An example of this scale is the opening melody (high) line of Bach's Bouree:
1 2 b3 2 1 7 1 2 6 7 1 2 1 b7 b6 5 4 b3 4 5 b6 5 4 b3 2
The sixth and seventh are major when the melody is in the process of ascending, and are minor when the melody is in the process of descending. You may look at the first seventh and think that it is descending, because the note preceding was the root, which is higher, but the note following is also the root, so which is it - ascending or descending? Looking back at the original premise from which the scale was developed, in order to avoide a step-and-a-half jump between the minor sixth and major seventh, we will have to look at the next note, not the previous note, in order to determine whether the melody is ascending or descending on that particular note. So we have to have a sort of musical ESP in knowing which note is coming next. This ensures that a b6 will never ascend to a 7.
Let us look at the permutations or modes of the melodic minor ascending scale.
Ionian-type: 12-7-64-350 = 2 3 #4 #5 6 7
Dorian-type: 12-7-64-346 a.k.a. Overtone = 2 3 #4 5 6 b7
Phrygian-type: 12-7-64-334 a.k.a. Hindu a.k.a. Acoustic - 2 3 4 5 b6 b7
Lydian-type: 12-7-64-243 = 2 b3 4 b5 b6 b7
Mixolydian-type: 12-7-64-147 a.k.a. Super Locrian a.k.a. Altered = b2 b3 b4 b5 b6 b7
Aeolian-type: 12-7-64-302 a.k.a. Melodic Minor Ascending = 2 b3 4 5 6 7
Locrian-type: 12-7-64-175 a.k.a. Javanese = b2 b3 4 5 6 b7
I marked the scales whose roots change ascend and descending with pink, and otherwise marked the two notes that change in red.
The chord structures in Melodic minor ascending are:
i ii III+ IV V viø viiø
Descending:
VII7 VI v iv III iiø i
In my numerical scale naming rubric, I will denote dynamic scales by the individual names and the parameters that determine which to use.
So the melodic minor scale is numerically denoted as:
(12-7-64-302 ascending / 12-7-66-299 descending)
There are also other reasons a scale can change, such as octave (bass, ow, medium, high), as may occur in some eastern musical forms. You should note that some eastern scales are more closely related to the harmonic series, and that the number of notes per octave increases per octave in the harmonic series. I will opine, though, that changing the intervals based on direction is a much more complicated task than adding intervals as the octave of the scale increases.