メインコンテンツまでスキップ

Interface: PianoLayout

Defined in: dom/src/piano/layout.ts:30

The geometry of a drawn keyboard.

One description is shared by the drawing and the hit testing, so a key cannot be drawn somewhere other than where it responds.

Properties​

blackKeyHeightRatio?​

optional blackKeyHeightRatio?: number;

Defined in: dom/src/piano/layout.ts:56

Height of a black key, as a fraction of the height of the keyboard.

Default​

0.6

blackKeyWidthRatio?​

optional blackKeyWidthRatio?: number;

Defined in: dom/src/piano/layout.ts:49

Width of a black key, as a fraction of PianoLayout.whiteKeyWidth.

Default​

0.65

keyGap?​

optional keyGap?: number;

Defined in: dom/src/piano/layout.ts:42

Space between two white keys. Part of the slot a white key occupies, so it still belongs to one of the keys for the purpose of hit testing.

Default​

1

noteRange​

noteRange: NoteRange;

Defined in: dom/src/piano/layout.ts:31


whiteKeyWidth​

whiteKeyWidth: number;

Defined in: dom/src/piano/layout.ts:34

Width of a white key, excluding PianoLayout.keyGap.