Skip to main content

match_pitches_to_quality

Function match_pitches_to_quality 

Source
pub fn match_pitches_to_quality(
    pitches: &mut [Pitch],
    root: Option<&Pitch>,
    quality: ImpliedQuality,
    written: &[u8],
) -> Result<()>
Expand description

Respells the third, fifth and seventh of a chord to the quality asked for.

This is music21’s _matchAccidentalsToQuality. The letters come from wherever the notes came from — a scale, usually — and the quality decides only the accidentals, so a minor reading of C E G gives C E- G and keeps the letters it was handed. Chord steps listed in written are left alone, which is how an accidental somebody wrote survives the correction.