hanonLegatoChromaticThird function

(Pitch, Pitch) hanonLegatoChromaticThird(
  1. int n, {
  2. int octaves = 0,
})

As duas notas (baixo, cima) da terça n da direita; o midi do dó3 é 48.

Implementation

(Pitch, Pitch) hanonLegatoChromaticThird(int n, {int octaves = 0}) {
  final offset = hanonLegatoChromaticOffset(n);
  final table = hanonLegatoChromaticDescends(n) ? _chromaticDown : _chromaticUp;
  final ((lowStep, lowAlter), (highStep, highAlter)) = table[offset % 12];
  final low = 48 + offset + 12 * octaves;
  // A de cima está sempre uma 3.ª menor (3 semitons) acima da de baixo.
  return (
    _spelled(lowStep, lowAlter, low),
    _spelled(highStep, highAlter, low + 3),
  );
}