KeyTrack

interface KeyTrack { enabled: boolean root: number scale: number events: readonly KeyEvent[] addEvent(props?: KeyEventProps): KeyEvent keyAt(position: number): Key clearEvents(): void }

The key of the song: a project key plus key changes along the timeline


Properties

enabled: boolean

Enable the key changes. Without them the project key applies everywhere

root: number

Root pitch class of the project key (0 to 11), applies before the first key change

scale: number

Scale mask of the project key, applies before the first key change

events: readonly KeyEvent[]

readonly

All key changes sorted by position

Methods

addEvent(props?: KeyEventProps): KeyEvent

Add a key change. Root and scale default to the key that applies at the position

Parameters

Returns

keyAt(position: number): Key

The key at a position

Parameters

  • position (number)

Returns

clearEvents(): void

Remove all key changes

Returns

  • void