miditoolkit
miditoolkit copied to clipboard
get note duration
How can i get actually note duration from midi_obj( midi_obj = miditoolkit.midi.parser.MidiFile() ), thanks? I find it's not right to get duration by codes fellow:
`
notes = midi_obj.instruments[0].notes
durations = []
pitchs = []
print(notes)
for n in notes:
pit = n.pitch
note = librosa.midi_to_note(pit)
pitchs.append(note)
offset = (n.end - n.start) / (1.0 * 1000)
durations.append(offset)
`