MIDI 文件中的未知事件
Unknown event in MIDI file
正如我之前发布的那样,我正在 Python 中编写一个 MIDI 解析器。我遇到一个错误,我的解析器卡住了,因为它正在尝试读取一个名为 2a
的事件,但这样的事件不存在。以下是相关 MIDI 文件的摘录:
5d7f 00b5 5d7f 00b6 5d7f 00b1 5d00 00b9
5d00 8356 9923 7f00 2a44 0192 367f 0091
237f 0099 4640 0092 2f7c 0099 3f53 0b3f
我已经手动解析了文件,但我和我的解析器卡在了同一个地方! MIDI 文件播放,所以我知道它是有效的,但我确定我读错了事件。
Standard MIDI Files 1.0 specification 说:
Running status is used: status bytes of MIDI channel messages may be omitted if the preceding event is a MIDI channel message with the same status. The first event in each MTrk chunk must specify status. Delta-time is not considered an event itself: it is an integral part of the syntax for an MTrk event. Notice that running status occurs across delta-times.
您的摘录将被解码如下:
delta <- event ------->
time status parameters
----- ------ ----------
... 5d 7f
00 b5 5d 7f
00 b6 5d 7f
00 b1 5d 00
00 b9 5d 00
83 56 99 23 7f
00 2a 44
01 92 36 7f
00 91 23 7f
00 99 46 40
00 92 2f 7c
00 99 3f 53
0b 3f ...
正如我之前发布的那样,我正在 Python 中编写一个 MIDI 解析器。我遇到一个错误,我的解析器卡住了,因为它正在尝试读取一个名为 2a
的事件,但这样的事件不存在。以下是相关 MIDI 文件的摘录:
5d7f 00b5 5d7f 00b6 5d7f 00b1 5d00 00b9
5d00 8356 9923 7f00 2a44 0192 367f 0091
237f 0099 4640 0092 2f7c 0099 3f53 0b3f
我已经手动解析了文件,但我和我的解析器卡在了同一个地方! MIDI 文件播放,所以我知道它是有效的,但我确定我读错了事件。
Standard MIDI Files 1.0 specification 说:
Running status is used: status bytes of MIDI channel messages may be omitted if the preceding event is a MIDI channel message with the same status. The first event in each MTrk chunk must specify status. Delta-time is not considered an event itself: it is an integral part of the syntax for an MTrk event. Notice that running status occurs across delta-times.
您的摘录将被解码如下:
delta <- event ------->
time status parameters
----- ------ ----------
... 5d 7f
00 b5 5d 7f
00 b6 5d 7f
00 b1 5d 00
00 b9 5d 00
83 56 99 23 7f
00 2a 44
01 92 36 7f
00 91 23 7f
00 99 46 40
00 92 2f 7c
00 99 3f 53
0b 3f ...