The chord to analyze, as a chord symbol, chord data, or a
Chord.
The prevailing key, as a key name, a key/scale, or a Key.
Options used when rendering the Roman numeral, plus
alternatives to collect the rejected readings.
The chord analysis.
import { analyzeChord, makeChord, majorKey } from '@libraz/libcantus';
analyzeChord(makeChord(7, 'dom7'), majorKey(0));
// { function: 'dominant', borrowed: false, source: null, roman: 'V7', ... }
analyzeChord(makeChord(9, 'dom7'), majorKey(0), { alternatives: true }).alternatives;
// [{ label: 'tonic by scale degree', reason: '...' }, ...]
Analyze a chord in a key: harmonic function, borrowing, and Roman numeral.
The function is quality-aware (see the predicates behind it), the source follows borrowedSource, and the numeral comes from chordToRoman.
borrowedis true whenever a source is identified, which includes the Neapolitan: it belongs to neither parallel mode, and both this and isBorrowedChord count it as a borrowing all the same.The
rationalesays which of those rules settled the function, so a reader who disagrees can see what the reading rests on.alternativesis empty unless asked for, and then names the readings that were turned down.