patternNotesOf function

List<PatternNote> patternNotesOf(
  1. PlayPatternSpec spec,
  2. KeySpec key, {
  3. PatternHand? hand,
})

As notas de spec no tom key, na ordem em que o aluno as toca: a mão 1 e a 2, passo a passo. Com uma mão só, as notas saem na pauta dela. hand troca a mão do exercício (o passo do hand: sequence, EX22).

Implementation

List<PatternNote> patternNotesOf(
  PlayPatternSpec spec,
  KeySpec key, {
  PatternHand? hand,
}) {
  switch (hand ?? spec.hand) {
    case PatternHand.right:
      return _flatten(_markedHand(spec, key, right: true), 1);
    case PatternHand.left:
      return _flatten(_markedHand(spec, key, right: false), 1);
    case PatternHand.both:
      return _interleave(
        _markedHand(spec, key, right: true),
        _markedHand(spec, key, right: false),
      );
    case PatternHand.contrary:
      // A mão 2 é a 1 espelhada: começa uma oitava abaixo e anda ao contrário.
      final left = _mirror(_steps(spec, key, right: true), key);
      _markArticulation(left, spec);
      return _interleave(_markedHand(spec, key, right: true), left);
  }
}