python - 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)?
解决方案
没有图书馆可以为您做到这一点。您必须从 时间签名元事件(或事件s,如果签名更改)确定每个小节的长度(以刻度为单位),然后从音符开和音符关消息的时间戳计算它们到哪个测量属于。(这两条消息可能以不同的方式结束。)
推荐阅读
- apache-flink - 将 func_type='pandas' 添加到 PyFlink UDF 会引发 ArrowTypeError('Did not pass numpy.dtype object'))
- rx-java - Micronaut 中反应式控制器方法的返回类型应该是什么?
- java - 实例化泛型类的正确方法
- javascript - 在 ServiceNow 中使用 ES5(仅使用 CDN 库)签署 HTTP 请求
- javascript - 将商品添加到购物车,该商品已经添加了另一个计数
- c# - SonarQube 测试覆盖率 .NET 5
- reactjs - 如何摆脱网格中的尾随空间
- javascript - 我们可以更新 MongoDB 中的文本索引吗?
- python - 用子类型覆盖子类型中的参数类型
- javascript - 我的电子应用程序中的 ReferenceError。从其他 JS 文件调用函数