Tonic and tonic parallel in C major: CM and Am chords Play (help·info).
A diatonic function (also chord area), in tonalmusic theory, is the specific, recognized role of each of the 7 notes and their chords in relation to the (diatonic) key. "Role" in this context means the degree of tension produced by moving away to a note, chord or scale other than the tonic; and at the same time "how" this musical tension would be eased ("resolved") towards the stability of returning to the tonic chord, note, or scale (namely, "function").
Each degree of the seven-tone diatonic scale has a name that relates to its function. The major scale and all three forms of the minor scale share these terms."
Three general and inseparable essential features of harmonic function in tonal music are:
Position within a gamut (the available collection) of notes determines a note's function
Each note within the gamut is a generator and collector of other notes in the gamut, in other words both the root and its chord exercise function, and
Exercise and identification of function depends on musical behaviour or structure.
A fourth feature is the ambiguity that arises from the use of the same terms to describe functions across all temporal spans of a hierarchical structure from the surface to the deepest level, and that the longer term or deeper functions act as a center for shorter higher level ones and that the functions of each tend to counteract each other . "Harmonic function essentially results from the judgment that certain chords and tonal combinations sound and behave alike, even though these individuals might not be analyzed into equivalent harmonic classes," for example V and VII. "Harmonic function is more about...similarity than equivalence".
In music theory, as it is commonly taught in the US, there are seven different functions. In Germany, from the theories of Hugo Riemann, there are only three, and functions other than the tonic, subdominant and dominant are called their "parallels" (US: "relatives"). See Functional harmony. For instance, in the key of C major, an A minor (chord, scale, or, sometimes, the note A itself) is the Tonic parallel, or Tp. (German musicians use only uppercase note letters and Roman numeral abbreviations, while in the US, upper- and lowercase are usually used to designate major or augmented, and minor or diminished, respectively.) In the US, it would be referred to as the "relative minor."
As d'Indy summarizes:
There is only one chord, a perfect chord; it alone is consonant because it alone generates a feeling of repose and balance;
this chord has two different forms, major and minor, depending whether the chord is composed of a minor third over a major third, or a major third over a minor;
this chord is able to take on three different tonal functions, tonic, dominant, or subdominant.
Note that the ii, iii, vi, and vii are lowercase; this is because in relation to the key, they are minor chords. Without accidentals, the vii is a diminished vii°.
The degrees listed according to function, in hierarchical order according to importance or centeredness (related to the tonic): I, V, IV, vi, iii, ii, vii°. The first three chords are major, the next three are minor, and the last one is diminished.
The tonic, subdominant, and dominant chords, in root position, each followed by its parallel. The parallel is formed by raising the fifth a whole tone; the root position of the parallel chords is indicated by the small noteheads.
Functions in the minor mode
In the US the minor mode or scale is considered a variant of the major, while in German theory it is often considered, per Riemann, the inversion of the major. In the late eighteenth-early nineteenth centuries a large number of symmetrical chords and relations were known as "dualistic" harmony. The root of a major chord in root position is its bass note, but, symmetrically, the 'root' of a minor chord in root position is the fifth (for example CEG and ACE). The plus and degree symbols, + and °, are used to denote that the lower tone of the fifth is the root, as in major, +d, or the higher, as in minor, °d. Thus, if the major tonic parallel is the tonic, with the fifth raised a whole tone, then the minor tonic parallel is the tonic with the US root/German fifth lowered a whole tone.
Note letter in C
Note letter in C
The minor tonic, subdominant, dominant, and their parallels, created by lowering the fifth (German)/root (US) a whole tone.
If chords may be formed by raising (major) or lowering (minor) the fifth a whole step, they may also be formed by lowering (major) or raising (minor) the root a half-step to wechsel, the leading tone or leitton. These chords are Leittonwechselklänge (literally: "leading-tone changing sounds"), sometimes called gegenklang or "contrast chord".
Major Leittonwechselklänge, formed by lowering the root a half step.
Minor Leittonwechselklänge, formed by raising the root (US)/fifth (German) a half step.
Three categories can appear in any one of three chordal guises in either of two modes, eighteen positions in all: T, Tp, Tl, t, tP, tL, S, Sp, Sl, s, sP, sL, D, Dp, Dl, d, dP, dL. Why all this complexity? Perhaps the central reason is that this ingenious, occasionally convoluted system enabled Riemann to achieve a grand and masterful synthesis of both the old and the new in late 19-century music. Ostensibly remote triads could be interpreted through the traditional terms of the I-IV-V-I, or now T-S-D-T, cadential schema. A sequence of Ab-major, Bb-major, and C-major chords, for example, could be neatly interpreted as a subdominant (sP) to dominant (dP) to tonic (T) progression in C-major, a reading of these chords not without support in certain late-Romantic cadences. And a chord that often perplexes harmony students, the Neapolitan chord Db major in a C-major context, could be shown to be nothing more than a minor-mode subdominant Leittonwechselklang (sL).
Some may at first be put off by the overt theorizing apparent in German harmony, wishing perhaps that a choice be made once and for all between Riemann's Funktionstheorie and the older Stufentheorie, or possibly believing that so-called linear theories have settled all earlier disputes. Yet this ongoing conflict between antithetical theories, with its attendant uncertainties and complexities, has special merits. In particular, whereas an English-speaking student may falsely believe that he or she is learning harmony "as it really is," the German student encounters what are obviously theoretical constructs and must deal with them accordingly.
Circle of fifths
Another theory regarding harmonic functionality is that "functional succession is explained by the circle of fifths (in which, therefore, scale degree II is closer to the dominant than scale degree IV)." According to Goldman's Harmony in Western Music, "the IV chord is actually, in the simplest mechanisms of diatonic relationships, at the greatest distance from I. In terms of the circle of fifths, it leads away from I, rather than toward it." Thus the progression I-ii-V-I would comply more with tonal logic. However, Goldman , as well as Jean-Jacques Nattiez, points out that "the chord on the fourth degree appears long before the chord on II, and the subsequent final I, in the progression I-IV-viio-iii-vi-ii-V-I."  Goldman also points out that, "historically the use of the IV chord in harmonic design, and especially in cadences, exhibits some curious features. By and large, one can say that the use of IV in final cadences becomes more common in the nineteenth century than it was in the eighteenth, but that it may also be understood as a substitute for the ii chord when it precedes V. It may also be quite logically construed as an incomplete ii7 chord (lacking root)."  However, Nattiez calls this, "a narrow escape: only the theory of a ii chord without a root allows Goldman to maintain that the circle of fifths is completely valid from Bach to Wagner." 
Tonicization and modulation
Functions during or after modulations and especially tonicizations are often notated in relation to the function, in the original key, which the tonicization was to. Sometimes called "function of function", for example, in C major, a D major chord root is notated as II, but during a tonicization on G major, it would be notated, as in G major, V, as it is the dominant of (in C major) the dominant, it is notated V/V (five of five). For example, the twelve bar bluesturnaround, I-V-IV-I, considered tonally inadmissible, may be interpreted as a doubled plagal cadence, IV/V-V-IV-I (IV/V-I/V, IV/I-I/I).
From the viewpoint of musical behaviour or structure there are three essential functions:
The dominant, dominant preparation and the tonic substitution all involve more than one scale degree with only the tonic and subdominant containing only one scale degree. Several scale degrees exercise more than one function.
The tonic includes four separate activities or roles as the:
Principal goal tone or event
Generator of other tones, and the
Stable center neutralizing the tension between dominant and subdominant, while the dominant has only the role of creating instability that requires the tonic or goal-tone for release.
The subdominant also acts as a dominant preparation. A tonic extension is an elaboration of an initiating event while substitution is an alteration of a cadential point or goal tone. Many of these functions may still be found in post-tonal music.
^ ab Harrison, Daniel (1994). Harmonic Function in Chromatic Music: A Renewed Dualist Theory and an Account of its Precedents, p.37. ISBN 0226318087.
^ abcde Gjerdingen, Robert O. (1990). "A Guide to the Terminology of German Harmony", Studies in the Origin of Harmonic Tonality by Dahlhaus, Carl, trans. Gjerdingen (1990). Princeton University Press. ISBN 0-691-09135-8.