const playerRef = useRef<MusicXmlPlayerHandle>(null);
const session = usePracticeSession({ score, musicxml, title, mode: 'metronome', bpm: 80, playerRef, onTakeGraded: history.save });
<MusicXmlPlayer ref={playerRef} fileUrl={url} loadEngine={loadEngine}
noteStyles={session.noteStyles} position={session.position}
transportActions={<RecordButton recorder={session.recorder} />}
onPlaybackEnded={session.handlePlaybackEnded} />
A practice session on a score: recording, following and grading in one.
Give it the score and how the take is to be paced — following the performer, a metronome with a count-in, or the score's own playback through the player — and it records the take, follows it live with a verdict per note, ends it when the piece does (or when the performer has gone quiet, or at a length limit), and grades it as surely as it can: MIDI, then the audio, then real time.
noteStylesandpositiongo straight to the score player;latestis the graded take.