generateHanonHold function
Monta o nº 37: cada compasso entre barras (menos o último) é um trecho tocado duas vezes, as notas presas vão no 1.º, e as barras agrupam de meio em meio compasso, como no livro.
Implementation
HanonPiece generateHanonHold(HanonHoldExercise ex) {
final sections = <HanonSection>[];
for (final (i, bar) in ex.bars.indexed) {
final last = i == ex.bars.length - 1;
sections.add(
HanonSection([
if (i == 0) ...[
..._held(ex.heldRight, ex.heldFingersRight, right: true),
..._held(ex.heldLeft, ex.heldFingersLeft, right: false),
],
...hanonByBeat(_notes(bar, right: true), _notes(bar, right: false)),
], times: last ? 1 : hanonHoldBarTimes),
);
}
return HanonPiece(
sections: sections,
time: ex.time,
beamUnits: 2 * kPatternDivisions,
);
}