alternativeAccidental property

NotePosition? alternativeAccidental

Implementation

NotePosition? get alternativeAccidental {
  switch (accidental) {
    case Accidental.None:
      return null;
    case Accidental.Sharp:
      // A flat is always the next note after a sharp, in the same octave
      return NotePosition(
          note: note.next, accidental: Accidental.Flat, octave: octave);
    case Accidental.Flat:
      // A sharp is always the previous note before a flat, in the same octave
      return NotePosition(
          note: note.previous, accidental: Accidental.Sharp, octave: octave);
  }
}