miditoolkit icon indicating copy to clipboard operation
miditoolkit copied to clipboard

get note duration

Open wotulong opened this issue 2 years ago • 0 comments

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)

`

wotulong avatar Oct 12 '22 08:10 wotulong