Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get note duration #15

Open
wotulong opened this issue Oct 12, 2022 · 0 comments
Open

get note duration #15

wotulong opened this issue Oct 12, 2022 · 0 comments

Comments

@wotulong
Copy link

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)

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant