The plan to read harmony from.
A chord timeline spanning plan.span.
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
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.harmonyis resolved against its key and placed at its own beat, so the timeline this returns always agrees with the plan it was built from.