A key signature is a set of sharp or flat symbols placed together on the staff at the beginning of a piece of music, indicating the key in which the music is to be played.