ReadonlyeventsThe events of the followed region, in score order
ReadonlyoptionsReadonlyscoreMilliseconds of audio consumed, or the latest MIDI or tick time
Where the running tempo places a stream time in the score, or null before a tempo is known.
End the session: attacks still waiting for audio are judged on what has been heard, an undecided placement stands, and the final snapshot is returned.
The current state.
Consume the next chunk of captured audio — one channel, or several to be mixed. Chunks must be shorter than a second or two; an attack's spectrum is read from the most recent four seconds.
Receive one MIDI note-on; notes within chordWindowMs of each other form one attack.
The performance so far as a report, from the confirmed verdicts. Notes not yet reached count as missing.
Start over on the same score and region.
Let time pass without input: closes a MIDI chord whose window has elapsed and settles an overdue placement.
Follow a performance through a score as it happens.
Feed it audio as it is captured (
pushAudio) or MIDI notes as they arrive (pushMidi); it finds each attack, decides where in the score it belongs, and reports a verdict for every expected note — first a quick provisional one, then a confirmed one once enough of the note has been heard. A placement the audio alone cannot settle — a wrong note looks like a skipped one until the note after it — stays provisional until the next attack chooses between the alternatives, or untilcommitAfterMshas passed. The current snapshot is available at any time (getSnapshot) and after every change throughonUpdate.By default the session follows the performer's own tempo. With
tempoit judges against a set one: timing is early or late against the beat, an event whose beat passes unplayed shows as missing until a note claims it, andclockQuarterssays where the beat is.Audio and MIDI are two ways of hearing the same performance; push one or the other, not both, or every attack is counted twice.
Example