首页 > 解决方案 > MIDI, how to get measures and notes

问题描述

Many MIDI libraries like mido and pretty_midi provide list of all messages in MIDI files. I am looking for a code to get the list of measures and all notes in each measure. Is there a specific library for calculating beats and measures (bars)?

标签: pythonmidi

解决方案


没有图书馆可以为您做到这一点。您必须从 时间签名元事件(或事件s,如果签名更改)确定每个小节的长度(以刻度为单位),然后从音符开和音符关消息的时间戳计算它们到哪个测量属于。(这两条消息可能以不同的方式结束。)


推荐阅读