A key signature is a set of sharps or flats placed at the beginning of a staff, after the clef, that indicates which notes are consistently raised or lowered throughout a piece. The key signature establishes the key and eliminates the need for repeated accidentals. Sharps and flats appear in key signatures in a specific order dictated by the circle of fifths. Sharps are added in the order F♯, C♯, G♯, D♯, A♯, E♯, B♯, easily remembered with the mnemonic Father Charles Goes Down And Ends Battle, where each new sharp is added a perfect fifth above the previous one. Flats appear in the reverse order: B♭, E♭, A♭, D♭, G♭, C♭, F♭, summarized as Battle Ends And Down Goes Charles' Father, with each new flat a perfect fourth above the previous one.
Identifying the major key from a key signature follows simple rules. For sharp key signatures, the major key is one half step above the last sharp: if the last sharp is F♯, the key is G major; if it is C♯, the key is D major. For flat key signatures with two or more flats, the major key is the second-to-last flat, so two flats (B♭ and E♭) indicate B♭ major. The exception is a single flat, which indicates F major. G major has one sharp, F♯; D major has two sharps, F♯ and C♯; and E♭ major has three flats, B♭, E♭, and A♭, and is a popular key for brass instruments and wind ensemble music.
Some keys are enharmonic, meaning they sound identical but are spelled differently. F♯ major (six sharps) and G♭ major (six flats) contain exactly the same pitches, as do B major and C♭ major, and D♭ major and C♯ major. The circle of fifths arranges all twelve keys in a circle with each key a perfect fifth apart from its neighbors: moving clockwise from C adds one sharp per step, while moving counterclockwise adds one flat per step. The circle is an essential tool for understanding key relationships, modulation, and the order of accidentals.
Every major key has a relative minor that shares the same key signature. The relative minor is found by going down a minor third from the major tonic, which lands on the sixth scale degree of the major scale; for example, the relative minor of C major is A minor, and both keys share the key signature of no sharps or flats. Modulation is the process of changing from one key to another within a piece, while transposition is the process of shifting all notes in a piece up or down by a constant interval while preserving melodic and harmonic relationships. Transposition is often used to accommodate a singer's range or to write parts for transposing instruments, instruments whose written pitch differs from their sounding pitch, such as the B♭ clarinet, B♭ trumpet, F horn, E♭ alto saxophone, and B♭ tenor saxophone.