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

    Class Progression

    An immutable ordered sequence of chords, optionally carrying a Key context shared by its analysis methods.

    import { Key } from '@libraz/libcantus';
    const key = Key.major('C');
    key.chord(1).progressionTo(key.chord(4), key.chord(0)).roman();
    // ['ii', 'V', 'I']
    Index
    • Voice the progression with smooth voice leading.

      Parameters

      • Optionalopts: VoicingOptions

        Voicing options; defaults to four SATB voices.

      Returns number[][]

      One ascending voicing (MIDI pitches) per chord.

      If any chord admits no voicing within the given ranges.

    • The Roman numeral of each chord in a key.

      Parameters

      • Optionalkey: Key

        Key to analyze in; falls back to the carried context.

      Returns string[]

      One numeral per chord.

      If no key is given and none is carried.

    • Analyze every chord and classify the closing cadence.

      The cadence is detected on the final chord pair and is null when the progression has fewer than two chords.

      Parameters

      • Optionalkey: Key

        Key to analyze in; falls back to the carried context.

      Returns { chords: ChordAnalysis[]; cadence: Cadence }

      Per-chord analyses and the closing cadence.

      If no key is given and none is carried.

    • The plain progression data, for JSON serialization.

      Private class fields do not serialize, so an explicit toJSON keeps JSON.stringify(progression) from collapsing to {}. The chords are emitted as plain data and the carried key, when present, as its own data.

      Returns { chords: ChordData[]; key: { scale: KeyScale; tonic: NoteData } | undefined }

      The chord data sequence and the carried key, if any.