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

    Function voiceChordStyled

    • Realize a single chord as an explicit tertian voicing in a chosen style, independent of the SATB range search used by voiceChord.

      The chord tones are stacked in close position from the bass (bassPc, else rootPc) in the given scientific-pitch octave upward (octave 4 starts the bass near C4 = MIDI 60, matching midiToNote and the bass module). When topNote is given the stack is rotated so the highest voice's pitch class equals that note (or the nearest chord tone). The chosen VoicingStyle then transforms the stack, and the result is returned as ascending MIDI pitches (index 0 = lowest).

      A drop voicing lowers one voice below the rest, so that voice is its bass — which is what tells the drop-2 voicings of one chord apart. When the chord names a bass tone of its own, the close stack is therefore rotated so the style drops that tone, and the result is the drop voicing whose bass is the tone asked for; the named bass is not lowered under an already dropped voice afterwards, which would leave a hole wider than an octave in the middle. A bass the chord does not contain is no voice of the stack and cannot be the dropped one, so it keeps the bottom and the drop happens above it.

      Every returned pitch is a valid MIDI number: an octave whose stack would run off either end of the 0..127 range is rejected rather than voiced out of range, matching nextVoicing, which clamps its derived ranges.

      Parameters

      • given: ChordLike

        The chord to voice, in whatever form it is held: a chord symbol, plain chord data, or a Chord.

      • Optionalopts: StyledVoicingOptions

        Styled voicing options; defaults to a close voicing at octave 4.

      Returns number[]

      MIDI pitches, ascending, one per retained voice.

      If the voicing would not fit inside MIDI 0..127 at the given octave.

      import { voiceChordStyled } from '@libraz/libcantus';
      voiceChordStyled('Dm7', { style: 'drop2' }); // ascending MIDI pitches, drop-2 voicing