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

    Function spanFromChord

    • Place a chord at a beat as a ChordSpan.

      The interval template is recorded only when it departs from the one the chord's quality names, so a span built from a standard chord carries the same fields it always did while a custom template is not lost.

      Parameters

      • chord: ChordData

        The chord to place.

      • startBeat: number

        Beat the chord starts on.

      Returns ChordSpan

      The span describing that chord at that beat.

      If startBeat is not finite, or the chord's quality is unknown.

      import { makeChord, spanFromChord } from '@libraz/libcantus';
      spanFromChord(makeChord(0, 'maj7'), 4);
      // { rootPc: 0, quality: 'maj7', startBeat: 4 } — no intervals for a standard chord