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

    Function nextVoicing

    • Voice a single chord to follow smoothly from an arbitrary current voicing.

      Candidate voicings of chord are enumerated within ranges taken from opts, or — when neither voices nor ranges is given — from a one-octave window around each pitch of current (so the result matches current's voice count). Each candidate is scored by structural quality, voice-leading motion from current, and a large penalty per counterpoint violation; the lowest scoring candidate is returned, ascending.

      Parameters

      • current: number[]

        The current voicing to lead from, ascending (index 0 = lowest).

      • chord: ChordData

        The next chord to voice.

      • Optionalopts: VoicingOptions

        Voicing options; when omitted, ranges follow current's span.

      Returns number[]

      The chosen voicing, ascending with one MIDI pitch per voice.

      If no voicing fits the derived ranges.