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

    Function analyzePolyphony

    • Label every note of one polyphonic passage against the harmony under it and the voices around it.

      analyzeVoice reads a single line: it takes the note before and the note after each note as that note's melodic neighbours, and it is given no other voices, so over a flat array of everything that sounds it invents figures across parts — the alto between two soprano notes becomes a passing tone — and can never find a suspension, which is by definition a dissonance against something else sounding. So the passage is partitioned into monophonic sub-voices first and each is read with the others handed to it, which is what analyzeArrangement does with the tracks it is given.

      Parameters

      • notes: readonly NoteEvent[]

        The passage, in any order; the ids are indices into this array.

      • chordAtBeat: (beat: number) => ChordData | null

        Chord sounding at a given beat, or null.

      • key: KeyContext

        The key, or the key in force at a given beat.

      Returns AnalyzedNote[]

      One annotation per note, in the order the notes were given, each carrying its position in that array as its id.