Skip to main content

enharmonic_fix

Function enharmonic_fix 

Source
pub fn enharmonic_fix(
    played: &Pitch,
    read: &Pitch,
    op: ChangeOp,
) -> Result<Option<EnharmonicFix>>
Expand description

What becomes of one note read, given the note the performance plays and what the alignment made of the pair: nothing where the spelling read stands.

This is music21’s EnharmonicFixer.fix for one change, and its five cases in music21’s order. Of two notes no more than a fifth apart by interval class:

  1. a reading’s natural is dropped where the notes sound alike, and where the reading is a semitone off it becomes the flat above or the sharp below the note played;
  2. a reading’s sharp or flat on the letter played takes the played note’s accidental;
  3. a sharp read a whole tone above the note played becomes a flat, and a flat read a whole tone below a sharp;
  4. a note played sharp or flat on the letter read, but read otherwise, takes the played pitch.

§Errors

An interval neither pitch spells, or an accidental no name spells.