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

    Function planTimeline

    • Read a plan's harmony as a chord timeline.

      The one way a generator or an evaluator reads chords out of a plan: each entry in plan.harmony is resolved against its key and placed at its own beat, so the timeline this returns always agrees with the plan it was built from.

      Parameters

      Returns ChordTimeline

      A chord timeline spanning plan.span.

      If the plan is not a valid composition plan.

      import { planTimeline, resolveKey } from '@libraz/libcantus';
      const plan = {
      planVersion: 1, seed: 0, algorithmVersion: 1,
      keys: [resolveKey('C major')], meters: [{ startBeat: 0, ts: { numerator: 4, denominator: 4 } }],
      span: { startBeat: 0, endBeat: 4, bars: 1 }, sections: [], phrases: [],
      harmony: [{ startBeat: 0, endBeat: 4, key: 0, roman: 'I' }], motifs: [],
      rhythm: { onsetLevels: [1, 0, 0, 0, 0, 0], interOnsetShares: new Array(17).fill(0).fill(1, 8, 9), syncopation: 0 },
      };
      planTimeline(plan).at(0); // the I chord in C major