Universal Music Theory Library - v0.12.0
    Preparing search index...

    Interface ModulationEvent

    A detected key change within a chord progression. Includes the index where modulation occurs and the type (pivot, direct, etc.).

    interface ModulationEvent {
        atIndex: number;
        fromKey: string;
        pivotChord?: Chord;
        toKey: string;
        type: "chromatic" | "direct" | "pivot" | "enharmonic" | "common-tone";
    }
    Index

    Properties

    atIndex: number

    Index of the first chord read in the new key.

    fromKey: string

    Key before the change, as passed in or as a previous event's toKey.

    pivotChord?: Chord

    The chord before atIndex, when it belongs to both keys.

    toKey: string

    New key, as 'G major' or 'C minor'.

    type: "chromatic" | "direct" | "pivot" | "enharmonic" | "common-tone"

    'pivot' when the chord before atIndex belongs to both keys, otherwise 'direct'. analyzeProgression only gives these two; Harmony.classifyModulation also tells 'enharmonic', 'chromatic' and 'common-tone'.