Hiyve Components - v1.0.0
    Preparing search index...

    Return value of useLivePerformance.

    interface UseLivePerformanceResult {
        estimateQuartersAt: (timeMs: number) => number | null;
        finish: () => PerformanceReport | null;
        isActive: boolean;
        position: MusicXmlPlayerPosition | null;
        pushAudio: (chunk: AudioChunk) => void;
        pushMidi: (event: MidiEvent) => void;
        report: PerformanceReport | null;
        reset: () => void;
        setTempo: (tempo: LiveTempoSetting | null) => void;
        snapshot: LiveSnapshot | null;
        tempo: LiveTempoSetting | null;
    }
    Index

    Properties

    estimateQuartersAt: (timeMs: number) => number | null

    Where the running tempo places a stream time in the score, for a smooth cursor

    finish: () => PerformanceReport | null

    End the session and grade it; the next input starts a new one

    isActive: boolean

    A session is running: input has arrived and finish() has not been called

    position: MusicXmlPlayerPosition | null

    Where the score viewer's position line belongs, for MusicXmlPlayer's position: under a set tempo a line gliding at the beat (the viewer animates it between renders); otherwise on the note expected next; null before anything has been played

    pushAudio: (chunk: AudioChunk) => void

    Feed a captured audio chunk (wire to useTakeRecorder's onAudioChunk)

    pushMidi: (event: MidiEvent) => void

    Feed a MIDI event (wire to onMidiEvent); only note-ons matter

    report: PerformanceReport | null

    The graded session, once finished

    reset: () => void

    Discard the session and its results

    setTempo: (tempo: LiveTempoSetting | null) => void

    Judge the next session against a set tempo, or follow the performer again with null. Call it before the session's first input — from the recorder's onRecordingStarted, once the metronome has started.

    snapshot: LiveSnapshot | null

    The latest state, or null before the first input of a session

    tempo: LiveTempoSetting | null

    The set tempo the next session will be judged against, or null to follow the performer