The key of a passage is a key whose diatonic tones best match the note names occurring in the passage.
The next figure shows a passage, the seven measures from the beginning of Mozart’s piano sonata K. 545. We see that each note name that occurs in the passage belongs to the C major scale. Thus, of all the major scales, the note names from the C major scale best matches with the note names that occur in the passage and we can conclude that the passage is written in the C major key.
Figure: The beginning seven measures from Mozart's piano sonata K. 545 are written in the C major key
Usually, not all the note names that occur in a passage are diatonic tones. Some of them might be altered tones. The important thing is that we cannot find a persistent usage of diatonic tones of another key because that would suggest a different key. For instance, we can continue with the next three measures. In measure 9, we see that the note name C# is used, which we know is not diatonic tone of the C major key. However, we also see that very soon, in the next measure, the note name C is used again. Thus, this is only a temporary usage of the note name C#. Therefore, we can conclude that we are still in the C major key.
We say that a composition is tonal if we can divide it into one or more passages such that, for each passage, we can determine its key. Thus, tonal music is, in every moment of time, organized around some major or minor key.
The theory of harmony requires such an organization. Therefore, it is only suitable for analysis of tonal music. Music from the baroque, classic and romantic period is tonal. Popular music is also tonal.
The level of organization that exists in tonal music allows for an easier comprehension. Listeners enjoy in tonal music because they are, most of the time, able to consciously or unconsciously recognize and follow certain patterns like chord progressions and cadences. Such patterns will be examined in the book.