Skip to content

get note duration #15

@wotulong

Description

@wotulong

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)

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions