music.hz_to_midi¶
- music.hz_to_midi(hertz_value)[source]¶
Converts a frequency in Hertz to a MIDI note number.
This function takes a frequency value in Hertz as input and returns the corresponding MIDI note number.
- Parameters:
- hertz_value
float The frequency value in Hertz to be converted.
- hertz_value
- Returns:
numpy.float64The MIDI note number corresponding to the input frequency value.
- Parameters:
hertz_value (float)
- Return type:
float64
Examples
>>> hz_to_midi(440) 69.0 >>> hz_to_midi(880) 81.0