librosa.hz_to_note(frequencies, **kwargs)[source]

Convert one or more frequencies (in Hz) to the nearest note names.

frequenciesfloat or iterable of float

Input frequencies, specified in Hz

kwargsadditional keyword arguments

Arguments passed through to midi_to_note

noteslist of str

notes[i] is the closest note name to frequency[i] (or frequency if the input is scalar)


Get a single note name for a frequency

>>> librosa.hz_to_note(440.0)

Get multiple notes with cent deviation

>>> librosa.hz_to_note([32, 64], cents=True)
['C1-38', 'C2-38']

Get multiple notes, but suppress octave labels

>>> librosa.hz_to_note(440.0 * (2.0 ** np.linspace(0, 1, 12)),
...                    octave=False)
['A', 'A#', 'B', 'C', 'C#', 'D', 'E', 'F', 'F#', 'G', 'G#', 'A']