Key signature key signatures showing sharps or flats on both octaves for notes which fall within the staff. An accidental is an exception to the key signature, applying only to the measure and octave in which it appears. Although a key signature may be written using any combination of sharp and flat symbols, the most common series of thirteen homogeneous key signatures—ranging from six flats to six sharps, with each successive flat or sharp placed on the note a perfect fifth below or above, respectively, the previous one—is assumed in much of this article. A piece scored using a single diatonic key
Key signature sometimes is this change indicated with a change of key signature; if not, the passage in the second key will not have a matching key signature. The Toccata and Fugue in D minor, BWV 538 by Bach has no key signature, leading it to be called the "Dorian", but it is still in D minor; the Bs that occur in the piece are written with accidentals. Keys which are associated with the same key signature are called relative keys. When musical modes, such as Lydian or Dorian, are written using key signatures, they are called "transposed modes". Exceptions to common-practice-period