Skip to main content

Function: createPianoInput()

function createPianoInput(element, options): PianoInputInstance;

Defined in: dom/src/piano/index.ts:105

Drive a piano keyboard with pointers, and own what is sounding.

Every way of playing a note goes through the one instance — pointers here, keyboard shortcuts and MIDI through PianoInputInstance.noteOn — so there is a single answer to what is currently held, and drawing the keys is left entirely to the wrapper.

Tracks every pointer at once, so a chord can be played with several fingers.

Parameters​

ParameterType
elementElement
optionsPianoInputOptions

Returns​

PianoInputInstance