audioflux.utils.midi_to_note

audioflux.utils.midi_to_note(midi, is_octave=True)

Convert MIDI number to note.

Parameters
midi: int or float

MIDI number

is_octave: bool

If Ture, then show the octave number

Returns
out: str

note name

Examples

>>> import audioflux as af
>>> af.utils.midi_to_note(0)
'C-1'
>>> af.utils.midi_to_note(24)
'C1'
>>> af.utils.midi_to_note(69.4)
'A4'
>>> af.utils.midi_to_note(69.7)
'A#4'
>>> af.utils.midi_to_note(90, octave=False)
'F#'