为什么 MIDI 提供 127 个音符

发布于 2024-10-19 14:19:44 字数 76 浏览 3 评论 0原文

MIDI 中的 127 个音符值是否具有音乐意义(一定数量的八度音阶或其他)?或者是由于二进制文件格式,IE为了计算的目的而设置为127?

Is the 127 note values in MIDI musically significant (certain number of octaves or something)? or was it set at 127 due to the binary file format, IE for the purposes of computing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

黯淡〆 2024-10-26 14:19:44

在 MIDI 协议中,有状态字节(想想命令,例如音符打开或音符关闭)和数据字节(想想参数,例如音高值和速度)。确定它们之间差异的方法是通过第一位。如果第一位是1,那么它是一个状态字节。如果第一位是0,那么它是一个数据字节。这样只剩下 7 位可用于其余状态或数据字节值。

因此,简而言之,这与协议规范有更多关系,但它恰好与大量可用的音调值很好地对齐。

现在,这些音高值对应于特定的音高。是的,确实通常 60 的音高值会给你 C4 或中音 C。大多数合成器都是这样工作的,但肯定不是全部 >。甚至不要求合成器使用音高值来表示音高! MIDI 并不关心...它只是一个协议。您可能想知道替代调音是如何工作的......它们工作得很好。由合成器来为这些交替调音产生正确的音高。 MIDI 仅提供 128 个不同值的选择以供发送。

另外,如果您想知道为什么第一位表示数据是什么如此重要......有些系统实时消息可以插入到其他命令的中间。这些是诸如定时时钟之类的东西,通常用于同步 LFO 等。

您可以在此处阅读有关 MIDI 消息类型的更多信息: http://www.midi.org/techspecs /midimessages.php

In the MIDI protocol there are status bytes (think commands, such as note-on or note-off) and there are data bytes (think parameters, such as pitch value and velocity). The way to determine the difference between them is by the first bit. If that first bit is 1, then it is a status byte. If the first bit is 0, then it is a data byte. This leaves only 7 bits available for the rest of the status or data byte value.

So to answer your question in short, this has more to do with the protocol specification, but it just so happens to nicely line up to good number of available pitch values.

Now, these pitch values do not correspond to specific pitches. Yes it is true that typically a pitch value of 60 will give you C4, or middle C. Most synths work this way, but certainly not all. It isn't even a requirement that the synth uses the pitch value for pitches! MIDI doesn't care... it is just a protocol. You may be wondering how alternate tunings work... they work just fine. It is up to the synthesizer to produce the correct pitches for these alternate tunings. MIDI simply provides for a selection of 128 different values to be sent.

Also, if you are wondering why it is so important for that first bit to signify what the data is... There are system realtime messages that can be interjected in the middle of some other command. These are things like the timing clock which is often used to sync up LFOs among other things.

You can read more about the types of MIDI messages here: http://www.midi.org/techspecs/midimessages.php

萌︼了一个春 2024-10-26 14:19:44

127 = 27 - 1

它是 8 位有符号整数的最大正值,因此在文件格式中是一个有意义的限制 - 它是可以存储在一个字节中的最高值(在 < em>大多数系统)而不使其未签名。

127 = 27 - 1

It's the maximum positive value of an 8-bit signed integer, and so is a meaningful limit in file formats--it's the highest value you can store in a byte (on most systems) without making it unsigned.

沒落の蓅哖 2024-10-26 14:19:44

我认为你错过的是 MIDI 是在 20 世纪 80 年代初创建的,不是为了在个人计算机上运行,​​而是为了在处理和存储能力极其有限的乐器上运行。在当时,存储 127 个值似乎是巨大的,特别是当最大的键盘通常只有 88 个键,而大多数电子乐器只有 48 个键时。如果您认为 MIDI 以一种奇怪的方式做事,那很可能源于它的侏罗纪遗产。

是的,通常音高值 60 会给你 C4,这是事实,
大多数合成器都是这样工作的,但肯定不是全部。

是的……关于中音 C 在 MIDI 中的位置一直存在争议。在 Yamaha 键盘上为 C3,在 Roland 键盘上为 C4。雅马哈采用了一种方式,而罗兰采用了另一种方式。

现在,这些音高值并不对应于特定的音高。

原来不是。然而,在“通用MIDI”标准中,A=440,这是标准调音。通用 MIDI 还描述了哪个音色是钢琴、哪个是吉他等等,以便 MIDI 文件可以跨多音色声源移植。

I think what you are missing is that MIDI was created in the early 1980's, not to run on personal computers, but to run on musical instruments with extremely limited processing and storage capabilities. Storing 127 values seemed GIANT back then, especially when the largest keyboard typically has only 88 keys, and most electronic instruments only had 48. If you think MIDI is doing something in a strange way, it is likely that stems from its jurassic heritage.

Yes it is true that typically a pitch value of 60 will give you C4,
or middle C. Most synths work this way, but certainly not all.

Yes ... there has always been a disagreement about where middle C is in MIDI. On Yamaha keyboards it is C3, on Roland keyboards it is C4. Yamaha did it one way and Roland did it another.

Now, these pitch values do not correspond to specific pitches.

Not originally. However, in the "General MIDI" standard, A = 440, which is standard tuning. General MIDI also describes which patch is a piano, which is a guitar, and so on, so that MIDI files become portable across multitimbral sound sources.

和我恋爱吧 2024-10-26 14:19:44

简单高效。

作为一种串行协议,MIDI 是围绕当时简单的串行芯片设计的,该芯片将接收 8 个数据位,并以规定的速率将它们作为流从一个单独的串行数据引脚传输出去。在 MIDI 世界中,该频率为 31,250 Hz。它添加了停止位和起始位,因此所有数据都可以通过一根电线传输。
它的设计成本低廉且简单,并且这种简单性也延伸到了数据格式中。

8 个数据位中的最高有效位用于指示数据字节是命令还是数据。所以-
在通道 1 上以 56 的速度发送中间 C 音符 ON 首先发送命令字节
注意的命令是该命令位 1001 的高 4 位。注意最高有效位中的 1,后面跟着通道 1 的通道 ID 0000(计算机更喜欢从 0 开始计数)

10010000 或 128 + 16 = 144

接下来是

中音 C 或 01001000 的实际音符数据 72

,然后再次在 0 -127 范围内指定速度数据,

在我们的例子中为 0 MSB 56

00111000
那么,接下来会发生什么(忽略停止启动和同步位)

144, 72, 56

对于当时电子键盘中几乎脑死亡的微型计算机来说,通过简单地查看第一位来将命令与数据分开的能力是一个天赐之物。

如前所述,127 位几乎涵盖了您想提及的任何西方键盘。因此,完全合乎逻辑,并且在许多串行协议消失很久之后协议仍然存在,这是对 http://en.wikipedia.org/wiki/Dave_Smith_(engineer) Sequential Circuits 的 Dave Smith,他开始与其他制造商进行讨论,以将这一切落实到位。

如果没有他和他们,现代音乐和作曲将会大不相同。

享受!

Simple efficiency.

As a serial protocol MIDI was designed around simple serial chips of the time which would take 8 data bits in and transmit them as a stream out of one separate serial data pin at a proscribed rate. In the MIDI world this was 31,250 Hz. It added stop and start bits so all data could travel over one wire.
It was designed to be cheap and simple and the simplicity was extended into the data format.

The most significant bit of the 8 data bits was used to signal if the data byte was a command or data. So-
To send Middle C note ON on channel 1 at a velocity of 56 A command bytes is sent first
and the command for Note on was the upper 4 bits of that command bit 1001. Notice the 1 in the Most significant bit, this was followed by the channel ID for channel 1 0000 ( computers preferring to start counting from 0)

10010000 or 128 + 16 = 144

This was followed by the actual Note data

72 for Middle C or 01001000

and then the velocity data again specified in the range 0 -127 with a 0 MSB

56 in our case

00111000
So what would go down the wire (ignoring stop start & sync bits was)

144, 72, 56

For the almost brain dead microcomputers of the time in electronic keyboards the ability to separate command from data by simply looking at the first bit was a godsend.

As has been stated 127 bits covers pretty much any western keyboard you care to mention. So made perfectly logical sense and the protocols survival long after many serial protocols have disappeared into obscurity is a great compliment to http://en.wikipedia.org/wiki/Dave_Smith_(engineer) Dave Smith of Sequential Circuits who started the discussions with other manufacturers to set all this in place.

Modern music and composition would be considerably different without him and them.

Enjoy!

睫毛上残留的泪 2024-10-26 14:19:44

127足以覆盖所有钢琴键

127 is enough to cover all piano keys

落在眉间の轻吻 2024-10-26 14:19:44

0 ~ 127 非常适合 ADC 转换。

许多 MIDI 硬件设备依赖于执行模数转换 (ADC)。考虑到 MIDI 是一种实时通信协议,在使用 逐次逼近< /a>(一种常用的算法),一个好的经验法则是使用 8 位分辨率来实现快速计算。这将产生 0 ~ 1023 范围内的值,可以通过除以 8 将其转换为 MIDI 范围。

0 ~ 127 fits nicely for ADC conversions.

Many MIDI hardware devices rely on performing Analog to Digital conversions (ADC). Considering MIDI is a real time communication protocol, when performing an ADC conversion using successive-approximation (a commonly used algorithm), a good rule of thumb is to use 8 bit resolution for fast computation. This will yield values in the 0 ~ 1023 range, which can be converted to MIDI range by dividing by 8.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文