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

    Interface PianoKeyboardProps

    Props for PianoKeyboard.

    interface PianoKeyboardProps {
        colors?: Partial<GameColors>;
        focusMidi?: number;
        highestMidi?: number;
        labels?: Partial<PianoKeyboardLabels>;
        lowestMidi?: number;
        markMiddleC?: boolean;
        marks?: readonly KeyMark[];
        minKeyWidth?: number;
        onKeyTap?: (midi: number) => void;
        readOnly?: boolean;
        selected?: readonly number[];
        showNames?: "all" | "c" | "none";
        sounding?: readonly number[];
        status?: StaffSlotStatus;
        sx?: SxProps<Theme>;
    }
    Index

    Properties

    colors?: Partial<GameColors>
    focusMidi?: number

    When the keyboard scrolls, the key it starts scrolled to (default: 60, middle C)

    highestMidi?: number

    The highest key (default: 83, the B two octaves up)

    labels?: Partial<PianoKeyboardLabels>
    lowestMidi?: number

    The lowest key (default: 60, middle C)

    markMiddleC?: boolean

    Write "middle C" on middle C, for a player who must find it among several octaves (default: false). No key is ever coloured for it: only lit keys are coloured

    marks?: readonly KeyMark[]

    Marks drawn on keys; marks on the same key share it, their labels written together ("1·3")

    minKeyWidth?: number

    The narrowest a white key may be drawn, in pixels; a keyboard that would be narrower is drawn in rows of whole octaves — the lowest at the bottom, the highest on top — and scrolls sideways only when one octave cannot fit (default: 40, a fingertip)

    onKeyTap?: (midi: number) => void

    A key was tapped; without this the keyboard is a picture

    readOnly?: boolean
    selected?: readonly number[]

    Keys lit as chosen

    showNames?: "all" | "c" | "none"

    Write letter names on the white keys: all of them, only the Cs, or none (default)

    sounding?: readonly number[]

    Keys lit while they sound, in the sounding colour (GameColors.sounding) — over a choice, while it lasts

    How the selection and marks are coloured once checked

    sx?: SxProps<Theme>