Final answer:
Musical keys are based on scales, which set the foundational pattern of intervals and pitches for a piece of music in a particular key.
Step-by-step explanation:
Musical keys are based on scales. A scale is a series of notes that are arranged in ascending or descending order of pitch. In Western music, a key is defined by the major or minor scale it uses, with the root note of the scale giving the key its name.
Each key has a different pattern of intervals between the notes, creating a unique set of pitches that defines the harmonic framework of the music. For example, the key of C major uses the notes C, D, E, F, G, A, and B, and it corresponds to the white keys on the piano starting from C. The concept of musical keys is closely related to other musical concepts such as the circle of fifths, which is used to show the relationship between different keys.