chordPlayShapeOf function

Future<MusicSongShape?> chordPlayShapeOf(
  1. MusicCatalog catalog,
  2. String hash, {
  3. String? transpose,
})

O formato da música de "Tocar pela cifra" (os trechos, na numeração da rodada): null se a partitura não se lê.

Implementation

Future<MusicSongShape?> chordPlayShapeOf(
  MusicCatalog catalog,
  String hash, {
  String? transpose,
}) async {
  final scored = await catalog.chordPlayScoreOf(hash, transpose: transpose);
  final plan = scored?.plan;
  if (plan == null) return null;
  return (
    sections: [for (var i = 0; i < plan.sections.length; i++) plan.barsOf(i)],
    hasWhole: plan.hasWhole(kMusicFreeLevel),
  );
}