generateHanonTremolo function

HanonPiece generateHanonTremolo(
  1. HanonTremoloExercise ex
)

Monta o nº 60: os seis trechos do livro, sem repetição.

Implementation

HanonPiece generateHanonTremolo(HanonTremoloExercise ex) {
  assert(
    hanonTremoloSections.fold<int>(0, (a, b) => a + b) == _bars.length,
    'os trechos somam ${_bars.length} compassos',
  );
  final sections = <HanonSection>[];
  var at = 0;
  for (final length in hanonTremoloSections) {
    sections.add(
      HanonSection([for (var i = at; i < at + length; i++) ..._bar(i)]),
    );
    at += length;
  }
  return HanonPiece(
    sections: sections,
    time: ex.time,
    unitsPerQuarter: hanonTremoloUnits,
    octaveShifts: [
      PatternOctaveShift(
        from: hanonTremoloRightShift.from,
        to: hanonTremoloRightShift.to,
      ),
    ],
  );
}