utils/notes

Methods

(static) FreqToCents(frequency, baseopt) → {number}

Source:

Returns the percents a frequency misses a real note by.

Parameters:
Name Type Attributes Description
frequency number

The frequency to translate.

base number <optional>

The frequency of A440.

Returns:

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

Type
number

(static) FreqToMIDI(frequency, baseopt) → {int}

Source:

Returns a MIDI note number for a frequency.

Parameters:
Name Type Attributes Description
frequency number

The frequency to translate.

base number <optional>

The frequency of A440.

Returns:

number - The MIDI number of the frequency.

Type
int

(static) FreqToNote(frequency, baseopt) → {string}

Source:

Returns a note name for a frequency.

Parameters:
Name Type Attributes Description
frequency number

The frequency to translate.

base number <optional>

The frequency of A440.

Returns:

note - The name of the note.

Type
string

(static) MIDIToFreq(note) → {number}

Source:

Returns a frequency of a MIDI note number.

Parameters:
Name Type Description
note int

The MIDI note to translate.

Returns:

frequency - The frequency of the MIDI number.

Type
number

(static) MIDIToNote(note) → {string}

Source:

Returns a note name for a MIDI note number.

Parameters:
Name Type Description
note int

The MIDI note to translate.

Returns:

note - The name of the note.

Type
string