Modulation is the process of changing key center. Modulation occurs in a number of ways, most of them involving some way of making the current key ambiguous and reaching a cadence in a new key. The key chosen is usually one closely related to the original key, those that share the key signature or have only one sharp or flat different in the key signature (for example, in C major, A minor, G major, and F major are all closely related keys). Modulation to other keys is not unknown, however, particularly in the Romantic era.
There are several means used to modulate. One is simply to introduce a new key, though this does not always sound very convincing and many consider it quite crude. In classical music, modulation is usually prepared and carried out through the use of pivot chords, which exist in both the starting key and the intended destination. Especially during the Romantic era, the possibilities of chromatic pivot chords, such as the diminished seventh, were heavily exploited..