The black keys are accidentals—they raise (♯) or lower (♭) a note by a semitone (half step).
Pattern: Groups of 2 and 3 black keys repeat across the keyboard. The group of 2 surrounds D; the group of 3 surrounds G–A–B.
They enable all 12 chromatic pitches, allowing modulation, chromaticism, and expression beyond the 7-note diatonic scale.