<!-- created April 19-->
David's MIDI Spec
revised 12 August 1992 - added Examples at end
revised 24 April 1995 - minor additions to program change & controller explanations
The official MIDI Spec is tricky and hard to read. I have distilled it here for your reading pleasure. -- David Van Brink
The MIDI Specification
Serial Protocol
31250 (?1%) baud asynchronous, with 1 start bit, 8 data bits, and one stop bit. Thus, each data byte takes 10 serial bits, and is sent in 320 microseconds. The connection is a 1.5 mA current loop, and the receiver is opto-isolated, and requires less than 5mA to turn on. Logical 0 is current "on." Rise and fall times must be less than 2 microseconds.
The MIDI Bus
The MIDI bus is designed to address 16 channels. More than this would seriously tax the bandwidth of the bus at 31.25 kbaud. Each device on the bus may receive on one or more channels. Sometimes, multiple devices may receive on the same channel, with various desired or undesired side-effects. The channels are numbered 1 to 16, and, at the low command level, are addressed as 0 to 15.
The MIDI bus operates in a one-way fashion; generally a computer and MIDI setup looks like this.
Each wire is one-way. The computer, therefore, receives no information from the two sound modules.
Message Formats
Messages consist of a byte stream. Bytes with the high-bit set establish some kind of mode and are called "status bytes." Bytes with the high-bit clear are data bytes within the most recently established mode. Using the same status byte for multiple data messages is referred to as "running status." Some status bytes are directed to a particular channel. In the chart below, the letter 'c' is used to represent a channel nibble in a status byte.
Note On, Note Off
The pitch is in the range 0 to 127, where Middle C is pitch number 60. Values outside the range of the instrument, or the particular sound, are octave-shifted into range. The "velocity" is how quickly, or hard, the key was struck. A velocity of zero in a note-on event is a note-off event. A velocity of 64 is "average," and a keyboard that cannot sense velocity should report a velocity of 64 for each keypress.
Key Pressure, Channel Pressure
Some keyboards can detect a change in pressure on each key, while they are held by the player; these keyboards can report "key pressure" over MIDI. Some keyboards may sense the overall pressure on the device, such as with a weight sensor beneath the entire keyboard. These devices can report "channel pressure."
Controller Change
Various sliders, buttons, and knobs on MIDI keyboards are referred to as "controllers." On sound modules, some of the attributes which can be changed in real-time are called "controllers." Controllers are numbered from 0 to 121, and some of them have defined purposes. The values 122-127 are reserved in the controller-change message for special mode messages.
Note that "MSB" and "LSB" refer to 7-bit values.
Program Change
A sound module may switch easily between as many as 128 different programmed sounds, numbered 0 to 127.
Many synthesizers support more than 128 programmed sounds by means of a "bank select" command. Older synths have typically used a device-specific system exclusive (see below) command. Newer synths use controllers 0 and 32 to select a bank. Unfortunately, there is no standard for whether it is, in fact, controller 0 or 32, or both, and if both, must be sent first.
Pitch Bend
The pitch bend wheel is also a continuous controller on many MIDI keyboards. Possibly, the Pitch Bend message is in its own category because it is something likely to be done frequently. The two bytes of the pitch bend message form a 14 bit number, 0 to 16383. The value 8192 (sent, LSB first, as 0x00 0x40), is centered, or "no pitch bend." The value 0 (0x00 0x00) means, "bend as low as possible," and, similarly, 16383 (0x7F 0x7F) is to "bend as high as possible." The exact range of the pitch bend is specific to the synthesizer.
System Exclusive, End of SysEx
A System Exclusive message, or "SysEx," is a message that is vendor, or synthesizer, specific. The first one or three data bytes of the sysex specifies the vendor. (Originally, it was only one byte, but now the value "0" is used as an escapement to reach the next two.) The sysex type message may legally occur at any time, including in the middle of other kinds of messages.
A sysex message may look like this: 0xF0 vendorID data ... 0xF7. Many vendors have their own format for what follows the vendor ID, specifying synthesizer number, or message length, and so on.
Song Position, Song Select
The Song Position message tells all MIDI sequencers on the MIDI bus where to start playing when a Start Song message is received. This time is specified in "Timing Ticks." The Song Select message specifies which song number to play at that time.
Unofficial Bus Select
Some vendors have produced boxes with a single MIDI input, and multiple MIDI outputs. The Bus Select message specifies which of the outputs further data should be sent to. This is not an official message; the vendors in question should have used a SysEx command.
Tune Request
Possibly obsolete in the age of digital synthesizers... supposed to tell the synthesizer to retune its oscillators.
Timing Tick
Tells all sequencers on the MIDI bus to advance by a single "tick."
Start Song, Continue Song, Stop Song
Tells all sequencers on the MIDI bus to start, continue, or stop playing.
Active Sensing
If a MIDI device receives an Active Sensing message, then it should enter "active sensing mode." In that mode, if no messages are received for 300 milliseconds, then it should silence all sound output. The Active Sensing byte itself is a valid message to inhibit this silencing. This helps make sure that a "hung" MIDI system automatically silences itself.
System Reset
This message commands a device to return to its initial, powerup state.
Examples
A Simple MIDI Stream
The following hexadecimal bytes are a simple, typical stream of MIDI data. Each message must be sent at the real-time that the synthesizer is supposed to perform the action. Sophisticated sequencers will send the message slightly ahead of time to account for the duration of the message -- one third of a millisecond per byte -- and the response time of the particular synthesizer -- perhaps several milliseconds. The perceptual improvement of accuracy under 5 or 10 milliseconds, to the untrained listener, is questionable.
90 3C 40
Play middle C (note number 60, hexadecimal 3C) on channel 1 (the zero nibble of 90), at half the full velocity (velocity 64, hexadecimal 40).
43 40
Play note G above middle C (note number 67, hexadecimal 43) at velocity 64. Note that the status byte of 90 from the first message is still in effect, and did not have to be resent.
B9 07 33
Change the volume of MIDI channel 10 to 51 (hexadecimal 33). The MIDI volume controller number is 7.
B3 07 10
Change the volume of MIDI channel 8 to 16 (hexadecimal 10). Since the channel number is different than the previous message, running status could not be used.
90 3C 00
Stop playing middle C on channel 1. The last byte of zero indicates a "key down velocity of 0" which indicates a "note-off" event.
80 43 64
Stop playing the G above middle C (key number 67, hexadecimal 43). The key is released with a velocity of 64. Since very few, if any, synthesizers implement an interpretation of the note-off volume, this message is generally equivalent to 90 43 00.
April 1994 - 11:16.AM
分享到:
相关推荐
中文名叫做统计学的世界,经典统计学入门书. 非常有趣的书。
学习PROE的初级入门模型,来自于清华大学翻译的美国David S.Kelley教授的PROE教程
sift创始人的代码:David Lowe's SIFT code
DBP (David's Batch Processor) 是 Gimp 的一个简单的批处理插件,它允许用户自动对一组图像文件执行操作(例如调整大小)。
该资源是David Silver的强化学习课程所对应的ppt。 该资源是David Silver的强化学习课程所对应的ppt。 该资源是David Silver的强化学习课程所对应的ppt。
[电磁场与电磁波].Cheng,.David.K,.Field.and.Wave.Electromagnetics,.Addison-Wesley,.2ed,.1989.719s_PHEI_.djvu
该文档改自 Bill Venables 和 David M. Smith (Insightful 公司) 描述 S 和 S-Plus 开发环境的讲义。我们只做了一些很小的修改以反映 R 和 S 的差异,并且扩充了一些材料。
david brill松鼠折紙 origami good
强化学习,David课件,David Silver深度强化算法学习 +项目讲解,
David Marr 1982年版'vision'的再版,非常经典的视觉的书籍
电磁场与电磁波第二版 David K.Cheng的答案
学习PROE的初级入门模型,来自于清华大学翻译的美国David S.Kelley教授的PROE教程
David Allen关于outlook用于 GTD的一篇文档,很好用
非常有名的统计学经典书籍,这本书读起来是比较轻松的,因为不需要太多的概率论基础,也没有很复杂的推导或公式。本书采用概率论的频率理论来讨论统计学,重视统计思想及引导如何应用统计学解决实际问题。...
无线通信大牛David Tse在台湾上课的课件,和他的书配套的,他的课程总共8,9个小时。课件对于David Tse的书的理解还是很有帮助的。
这是David Silver的强化学习课程的课件,共10个课件,可以去网站找到对应的视频作为配合对照。主要包括马尔科夫决策过程、动态规划、蒙特卡洛采样算法、动态差分法、策略梯度等。
很好的外国课件!David Patterson,系统结构的最好的课程的课件!
pdf 格式《统计学》 David Freedman等著,魏宗舒,施锡铨等译 中国统计出版社 。据说是统计思想讲得最好的一本书,读了部分章节,受益很多。整本书几乎没有公式,但是讲到了统计思想的精髓。 本书不是很清晰,但是...
David Silver深度强化学习课程2020版课件,从David Silver个人网站直接的下载的
This repo contains matlab scripts of David Tedaldi's ICRA14 paper, a robust and easy to implement method for IMU calibration.zip