Skip to content

Utils

NoteData

NoteData(int_or_name: int | str, use_flats: bool = False)

Optional wrapper for readable representation of MIDI note data. When using it as int - it's note's MIDI data, when using as str - it's note's name.

Parameters:

  • int_or_name (int | str) –

    note MIDI data (0-127) or note name (like 'C#3' or 'Db3')

  • use_flats (bool, default: False ) –

    True to use flats in note name (Db3), False to use sharps (C#3)

middle_c_octave_n

middle_c_octave_n = 3

Octave number for middle C to use as reference for note naming

as_str

as_str() -> str

Note name. Same as str(note_data_obj).

as_int

as_int() -> int

Note MIDI data. Same as int(note_data_obj).