Spell a voicing given as MIDI pitches, so it can be checked by
checkPartWriting.
Each pitch is named against the chord sounding under it and then the key, so a
chord tone takes the letter the degree it plays in that chord implies: the
third of a D major chord in C major spells F#, not Gb. The chord is passed
whole rather than by its root, so a chord carrying its own spelling names its
tones here exactly as spellChord names them — the German sixth keeps
the F# that resolves outward to the dominant. The octave is kept, since the
rules measure real distances.
import { majorKey, makeChord, noteNames, spellVoicing } from'@libraz/libcantus'; noteNames(spellVoicing([50, 57, 66, 69], makeChord(2, 'maj'), majorKey(0))); // ['D3', 'A3', 'F#4', 'A4'] — the third of D spells F# in C major
Spell a voicing given as MIDI pitches, so it can be checked by checkPartWriting.
Each pitch is named against the chord sounding under it and then the key, so a chord tone takes the letter the degree it plays in that chord implies: the third of a D major chord in C major spells F#, not Gb. The chord is passed whole rather than by its root, so a chord carrying its own spelling names its tones here exactly as spellChord names them — the German sixth keeps the F# that resolves outward to the dominant. The octave is kept, since the rules measure real distances.