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

    Function developMotif

    • Lay a motif across bars and snap it to a chord timeline.

      The cell is tiled back-to-back to fill the requested span; each note is then pulled to the nearest chord tone of the segment sounding at its onset, so the developed line spells the underlying harmony.

      Parameters

      • cell: MotifCell

        The source motif.

      • timeline: ChordTimeline

        Chord segments to snap against.

      • key: KeyScale

        Key context (used to keep snapped pitches sensible).

      • bars: number

        Number of four-beat bars to fill.

      Returns MotifCell

      The developed, harmony-aware cell.

      import { chordTimelineFromChords, developMotif, generateMotif, majorKey } from '@libraz/libcantus';
      const key = majorKey(0);
      const timeline = chordTimelineFromChords([{ rootPc: 0, quality: 'maj', startBeat: 0 }], 8);
      const developed = developMotif(generateMotif({ key, bars: 1 }), timeline, key, 2);