Caution

You're reading the documentation for a development version. For the latest released version, please have a look at 0.11.0.

librosa.note_to_hz

librosa.note_to_hz(note, *, round_midi=False)[source]

Convert one or more note names to frequency (Hz)

Parameters:
notestr or iterable of str

One or more note names to convert

round_midibool (default=False)

If True, quantize the note to the nearest MIDI pitch before conversion. If False, allow for cent deviations in converting to Hz.

Returns:
frequenciesnumber or np.ndarray [shape=(len(note),)]

Array of frequencies (in Hz) corresponding to note

Examples

>>> # Get the frequency of a note
>>> librosa.note_to_hz('C')
array([ 16.352])
>>> # Or multiple notes
>>> librosa.note_to_hz(['A3', 'A4', 'A5'])
array([ 220.,  440.,  880.])
>>> # Notes with tuning deviations
>>> librosa.note_to_hz(['C2-32', 'C2'])
array([ 64.209,  65.406])
>>> # Or discarding tuning deviations
>>> librosa.note_to_hz(['C2-32', 'C2'], round_midi=True)
array([ 65.406,  65.406])