In Western tonal music, a key represents the most common pitches and the center of tonal stability in a song or other composition.
A key has two components: a tonic pitch and a mode. The tonic pitch is represented by a letter from A through G, sometimes modified by the accidental symbols ♯ (sharp) and ♭ (flat). This tonic represents the musical pitch which a piece will be oriented around and almost always conclude with. The mode may be Major or Minor; if no mode is specified, Major is usually implied. This mode represents a pattern of ascending or descending pitches, which can create a major or minor musical scale beginning with the tonic pitch. Music in a given key will use the pitches from this scale (called diatonic pitches) more often than the pitches outside it (chromatic pitches). Together, these result in keys with names like C Major, A Minor, and B♭ Major. Not all music has a well-defined key.
