Major scales explained on a virtual piano

A major scale is a sequence of notes x1,x2,x3,x4,x5,x6,x7,x8 such that

x2 is 2 semitones higher than x1
x3 is 2 semitones higher than x2
x4 is 1 semitone higher than x3
x5 is 2 semitones higher than x4
x6 is 2 semitones higher than x5
x7 is 2 semitones higher than x6
x8 is 1 semitone higher than x7

Alternatively, treating notes as integers, (x1,x2,x3,x4,x5,x6,x7,x8) is a major scale iff (x1,x2,x3,x4,x5,x6,x7,x8)=(x1,x1+2,x1+4,x1+5,x1+7,x1+9,x1+11,x1+12).

This virtual piano plays only major scales.

Note that the C major scale is the only major scale composed entirely of white keys. Other major scales contain at least one black key.

Note that a major scale contains two major triads and two minor triads:
The first major triad is composed of the 1st, 3rd, and 5th steps while the second major triad is composed of the 4th, 6th, and 8th steps.
The first minor triad is composed of the 2nd, 4th, and 6th steps while the second minor triad is composed of the 3rd, 5th, and 7th steps.
In the C major scale, the two major triads are: C,E,G and F,A,C, while the two minor triads are D,F,A and E,G,B.

Check out our definition of natural minor scales also explained on a virtual piano.