TK.Notes

Notes converts between frequencies, MIDI notes and note names.

Source:

Methods

freq2cents(frequency) → {number}

Returns the percents a frequency misses a real note by.

Parameters:
Name Type Description
frequency number

The frequency to translate.

Source:
Returns:

cents - The percent of the difference to the next full note.

Type
number

freq2midi(frequency) → {int}

Returns a MIDI note number for a frequency.

Parameters:
Name Type Description
frequency number

The frequency to translate.

Source:
Returns:

number - The MIDI number of the frequency.

Type
int

freq2note(frequency) → {string}

Returns a note name for a frequency.

Parameters:
Name Type Description
frequency number

The frequency to translate.

Source:
Returns:

note - The name of the note.

Type
string

midi2freq(note) → {number}

Returns a frequency of a MIDI note number.

Parameters:
Name Type Description
note int

The MIDI note to translate.

Source:
Returns:

frequency - The frequency of the MIDI number.

Type
number

midi2note(note) → {string}

Returns a note name for a MIDI note number.

Parameters:
Name Type Description
note int

The MIDI note to translate.

Source:
Returns:

note - The name of the note.

Type
string