MIDI:将 BPM 转换为 FPS 增量时间?
给定速度为 192 的 BPM(每分钟节拍)MIDI 增量时间(最左边位关闭):
0x00C0
我想将其转换为 FPS/TPM(每秒帧数/每分钟滴答数)增量时间(最左边位打开),但它如果你明白我的意思的话,应该是相同的(或最准确的)速度值。
有关 MIDI 增量时间的更多信息,请查看标题块下的 Midi 文件格式 ->时间划分。
我正在寻找一个可以在这两种增量时间类型之间进行转换的公式。
Given a BPM (beats per minute) MIDI delta time (leftmost bit off) with speed of 192:
0x00C0
I want to convert it to a FPS/TPM (frames per second / ticks per minute) delta time (leftmost bit on), but it should be the same (or the most accurate) speed value if you know what I mean.
For more info about MIDI Delta Time please take a look at Midi File Format under Header Chunk -> Time Division.
I am looking for a formula that will convert between these two deltatime types.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你说 0x00C0 是时分字段,那么你指的不是每分钟 192 节拍,而是每节拍 192 节拍,这是完全不同的兽。 BPM 通过“Set Tempo”事件间接指定,以每节拍的微秒为单位(假设以普遍存在的 120 BPM 开始)。这种格式的时间划分的棘手之处在于,滴答声的长度会根据歌曲的节奏变化而增加和缩短。
假设您要转换的时分使用
F
作为每秒帧数(24、25、29.97 或 30),使用G
作为每帧的刻度数 (< em>注意:这不是每分钟的滴答数!)。此外,我们假设当前节奏(每节拍微秒)为p
。然后,将给定持续时间(以刻度旧为单位)转换为刻度新(单位分析确实很有帮助!)的公式是:If you're talking about 0x00C0 being the time division field, what you're referring to is not 192 beats per minute, but rather 192 ticks per beat, quite a different beast. BPM is specified indirectly via "Set Tempo" events, given in microseconds per beat (with the lamentably ubiquitous 120 BPM being assumed to begin with). The trickiness of time division with this format is that the length of a tick will grow and shrink depending on the tempo changes in the song.
Let's say the time division you want to convert to has
F
as the frames per second (24, 25, 29.97, or 30) andG
as the ticks per frame (note: it's not ticks per minute!). Further, let's assume that the current tempo in microseconds per beat isp
. Then the formula to convert a given duration in ticksold to ticksnew (the unit analysis really helps!) is: