librosax.feature.note_to_hz¶
- note_to_hz(note: str, **kwargs: Any) floating[Any][source]¶
- note_to_hz(note: List[str] | Tuple[str, ...] | Generator[str, None, None], **kwargs: Any) Array
- note_to_hz(note: str | List[str] | Tuple[str, ...] | Generator[str, None, None] | Iterable[str], **kwargs: Any) floating[Any] | Array
Convert one or more note names to frequency (Hz).
- Parameters:
note – One or more note names to convert.
**kwargs – Additional parameters to note_to_midi.
- Returns:
Array of frequencies (in Hz) corresponding to
note.
See also
midi_to_hz: Convert MIDI note numbers to frequencies. note_to_midi: Convert note names to MIDI numbers. hz_to_note: Convert frequencies to note names.
Examples
>>> # Get the frequency of a note >>> librosax.note_to_hz('C') array([ 16.352]) >>> # Or multiple notes >>> librosax.note_to_hz(['A3', 'A4', 'A5']) array([ 220., 440., 880.]) >>> # Or notes with tuning deviations >>> librosax.note_to_hz('C2-32', round_midi=False) array([ 64.209])