@libraz/libcantus - v1.1.0
    Preparing search index...

    Function functionOf

    • The harmonic function of a chord in a key.

      The root's offset above the tonic gives the baseline mapping, which follows common-practice major-key function and is a useful approximation in minor and for borrowed chords. Chord quality then refines it where the sonority settles an ambiguity the root offset cannot:

      • A chord that sounds like a dominant — a major third with a minor seventh, or a diminished-family chord — and is neither diatonic to the key nor borrowed from its parallel mode has dominant function when its root resolves onto a degree that can be made a local tonic. This is what makes an applied dominant (A7 in C, which tonicizes ii) and its tritone substitute (Db7) read as dominant rather than inheriting the function of the degree they happen to sit on. A bare major triad carries no tritone, so it only tonicizes by falling a fifth onto a degree other than the tonic: the Picardy third of a minor key and its borrowed major IV sound their own degrees.
      • The Neapolitan is subdominant.
      • An augmented sixth is subdominant. All three are altered predominants that resolve outward onto the dominant, so they take subdominant function even though the German sixth sounds a dominant seventh and would otherwise read as the tritone substitute it shares its pitch classes with.
      • A major triad on bVI or bVII of a major key is subdominant — the borrowed pop cadence chord, distinct from the bVII7 above, which has a seventh and is a dominant sonority.

      Parameters

      • chord: ChordLike

        The chord, as a chord symbol, chord data, or a Chord.

      • key: KeyLike

        The prevailing key, as a key name, a key/scale, or a Key.

      Returns HarmonicFunction

      The harmonic function.

      import { functionOf, makeChord, majorKey } from '@libraz/libcantus';
      functionOf(makeChord(9, 'dom7'), majorKey(0)); // 'dominant' — A7 tonicizes ii
      functionOf('Bb', 'C major'); // 'subdominant' — borrowed bVII