VirtualScore.ofRunner constructor
- ScoreRoundRunner runner
A passagem de runner (já carregado com load): as notas do aluno que a
sessão avalia, com o que ela não avalia de fora.
Implementation
factory VirtualScore.ofRunner(ScoreRoundRunner runner) {
final round = runner.round;
final practice = runner.practice;
final timeline = runner.timeline;
final track = PerformanceTrack.fromDocument(runner.document);
final range = practice.range;
final session = range == null
? track
: track.rangeView(
startMs: range.startMs,
endMs: range.endMs,
gaps: practice.rangeJumps,
);
final staves = practice.hand.studentStaves;
final chords = [
for (final note in round.chordReference)
if (staves.contains(kChordNoteStaff) && _inRound(note.onMs, practice))
_soundOf(note),
];
return VirtualScore(
track: track,
events: _withChords([
for (final e in session.events)
if (staves.contains(e.staff) &&
!round.appNotes.contains(e.id) &&
!round.silentNotes.contains(e.id))
e,
], chords),
spans: [
for (final m in timeline.measures)
(startMs: m.startMs.toDouble(), endMs: m.endMs.toDouble()),
],
ornaments: round.ornaments,
staves: staves,
beatMs: 60000 / fileTempoOf(timeline),
practice: practice,
chordNotes: chords,
);
}