问题描述
MIDI标头块的最后一个字指定分隔.它包含有关增量时间应解释为每四分音符的滴答声还是每帧的滴答声(其中帧是一秒的细分)的信息.如果设置了该字的第15位,则信息以每帧的滴答度为单位.接下来的7位(第14位到第8位)指定每秒的帧数,并且可以包含以下四个值之一:-24,-25,-29或-30.(它们是负面的)
The last word of a MIDI header chunk specifies the division. It contains information about whether delta times should be interpreted as ticks per quarter note or ticks per frame (where frame is a subdivision of a second). If bit 15 of this word is set then information is in ticks per frame. Next 7 bits (bit 14 through bit 8) specify the amount of frames per second and can contain one of four values: -24, -25, -29, or -30. (they are negative)
有人知道位15是否计入该负值?所以问题是,指定fps的值实际上是8位长(15到8)还是7位长(14到8).我正在阅读的文档对此不太清楚,在其他任何地方都找不到信息.
Does anyone know whether the bit 15 counts towards this negative value? So the question is, are the values which specify fps actually 8 bits long (15 through 8) or are they 7 bit long(14 through 8). The documentation I am reading is very unclear about this, and I can not find info anywhere else.
谢谢
推荐答案
MMA的标准MIDI文件格式规范说:
The MMA's Standard MIDI-File Format Spec says:
+---+-----------------------------------------+
| 0 | ticks per quarter-note |
==============================================|
| 1 | negative SMPTE format | ticks per frame |
+---+-----------------------+-----------------+
|15 |14 8 |7 0 |
[...]如果< division>的第15位为1,则文件中的增量时间对应以与SMPTE和MIDI一致的方式细分到一秒时间码.位14至8包含以下四个值之一:-24,-25,-29,或-30,对应于四个标准的SMPTE和MIDI时间码格式(-29对应30滴),代表每秒的帧数.这些负数存储在补码形式.第二个字节(存储为正)是帧内的分辨率[...]
[...] If bit 15 of <division> is a one, delta times in a file correspond to subdivisions of a second, in a way consistent with SMPTE and MIDI Time Code. Bits 14 thru 8 contain one of the four values -24, -25, -29, or -30, corresponding to the four standard SMPTE and MIDI Time Code formats (-29 corresponds to 30 drop frome), and represents the number of frames per second. These negative numbers are stored in two's complement form. The second byte (stored positive) is the resolution within a frame [...]
Two的补数表示允许对负值进行符号扩展,而无需通过添加来更改其值一个MSB值1.因此,占用7位还是8位都没有关系.
Two's complement representation allows to sign-extend negative values without changing their value by adding a MSB bit of value 1.So it does not matter whether you take 7 or 8 bits.
实际上,该值被设计为解释为带符号的8位值,因为否则它将被存储为正值.
In practice, this value is designed to be interpreted as a signed 8-bit value, because otherwise it would have been stored as a positive value.
这篇关于标题块中的MIDI分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!