sightChangesFor function

List<SightChange> sightChangesFor(
  1. String tonic, {
  2. SightExercise? ex,
})

As mudanças que cabem na armadura tonic: pitch e rhythm sempre; accidental com armadura ou, dado o exercício ex, com acidente escrito (o sol♯ de lá menor, mesmo em dó maior).

Implementation

List<SightChange> sightChangesFor(String tonic, {SightExercise? ex}) => [
  SightChange.pitch,
  SightChange.rhythm,
  if (KeySignature.parse(tonic).fifths != 0 ||
      (ex != null && _hasWrittenAccidental(ex)))
    SightChange.accidental,
];