Skip to content

NoteFormatter

Defined in: packages/pleco-xa/src/scripts/xa-display.js:892

Note formatter for converting frequency/pitch values to musical note names

  • AxisFormatter

new NoteFormatter(options?): NoteFormatter

Defined in: packages/pleco-xa/src/scripts/xa-display.js:899

Formatter options

string = 'C:maj'

Key signature (default: ‘C:maj’)

number = 0

Octave offset (default: 0)

boolean = true

Use unicode sharp/flat symbols (default: true)

NoteFormatter

AxisFormatter.constructor

key: string

Defined in: packages/pleco-xa/src/scripts/xa-display.js:901


noteNames: string[]

Defined in: packages/pleco-xa/src/scripts/xa-display.js:905


octave: number

Defined in: packages/pleco-xa/src/scripts/xa-display.js:903


unicode: boolean

Defined in: packages/pleco-xa/src/scripts/xa-display.js:902

call(value): string

Defined in: packages/pleco-xa/src/scripts/xa-display.js:915

Format MIDI note number to note name

number

MIDI note number

string

Note name (e.g., “C4”, “A♯3”)

AxisFormatter.call


format(value, index): string

Defined in: packages/pleco-xa/src/scripts/xa-display.js:849

Make formatter callable (JavaScript equivalent of Python’s call)

number

Tick value

number

Tick index

string

Formatted label

AxisFormatter.format