@libraz/libcantus - v0.9.3
    Preparing search index...

    Function diatonicTriad

    • Build the diatonic triad rooted on a scale degree by stacking scale thirds.

      Unlike chordFromDegree, the chord quality is derived from the scale rather than supplied, so degrees yield their scale-correct triads (e.g. a diminished triad on the leading tone of a major key). Intended for heptatonic scales; other scales stack by scale step regardless.

      Parameters

      • degree: number

        0-based scale degree of the chord root.

      • key: KeyScale

        Key/scale context.

      Returns ChordData

      The diatonic triad.

      import { majorKey, diatonicTriad } from '@libraz/libcantus';
      const tonic = diatonicTriad(0, majorKey(0)); // C major triad (degree 0 of C major)