Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
MIDI
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Technical specifications== [[File:8-N-1 MIDI two-bytes.png|thumb|342x342px|8-N-1 [[asynchronous serial communication]] of two MIDI bytes. Each 8-bit byte is preceded by a start bit and succeeded by a stop bit for [[Frame synchronization|framing]] purposes, to total 10 bits.<ref name="Manning3" />{{rp|286|date=November 2012}} So while the 31,250 [[baud rate]] corresponds to 31.25 [[kbit/s]], the [[net bit rate|''net'' bit rate]] is only 25 kbit/s. Each byte with its frame uses 320 [[microseconds]].<ref name="MIDI specification">{{cite web |last=MMA |title=MIDI DIN Electrical Specification |url=http://www.midi.org/techspecs/ca33.pdf |url-status=live |archive-url=https://web.archive.org/web/20151222120442/http://www.midi.org/techspecs/ca33.pdf |archive-date=22 December 2015 |access-date=31 August 2016}}</ref>]] MIDI messages are made up of 8-bit [[bytes]] transmitted at 31,250{{efn|The 31,250 [[baud rate]] is used because it is an exact division of 1 MHz,<ref name="Manning3" />{{rp|286|date=November 2012}} a common divisor of the maximum [[clock rate]] of most [[Microprocessor chronology|early microprocessors]].}} (Β±1%) [[baud]] using 8-N-1 [[asynchronous serial communication]] as described in the figure. The first bit of each byte identifies whether the byte is a ''status'' byte or a ''data'' byte, and is followed by seven bits of information.<ref name="Huber 1991" />{{rp|13β14|date=November 2012}} A MIDI link can carry sixteen independent channels, numbered 1β16. A device may listen to specific channels and ignore messages on other channels (''omni off'' mode), or it can listen to all channels, effectively ignoring the channel address (''omni on''). A device that is [[polyphonic]] can sound multiple notes simultaneously, until the device's polyphony limit is reached, or the notes reach the end of their [[ADSR envelope#ADSR envelope|decay envelope]], or explicit ''note-off'' MIDI commands are received. A device that is [[monophonic]] instead terminates any previous note when new ''note-on'' commands arrive. ''Some'' receiving devices may be set to all four combinations of ''omni off/on'' and ''mono/poly'' modes.<ref name="Huber 1991" />{{rp|14β18|date=November 2012}} ===Messages=== A MIDI message is an instruction that controls some aspect of the receiving device. A MIDI message consists of a status byte, which indicates the type of the message, followed by up to two data bytes that contain the parameters.<ref name="Brewster">Brewster, Stephen. "Nonspeech Auditory Output". ''The Human-Computer Interaction Handbook: Fundamentals, Evolving Technologies, and Emerging Applications''. Ed. Julie A. Jacko; Andrew Sears. Mahwah: Lawrence Erlbaum Associates, 2003. p.227</ref> MIDI messages can be ''channel messages'' sent on only one of the 16 channels and monitored only by devices on that channel, or ''system messages'' that all devices receive. Each receiving device ignores data not relevant to its function.<ref name="Gibbs" />{{rp|384|date=November 2012}} There are five types of message: Channel Voice, Channel Mode, System Common, System Real-Time, and System Exclusive.<ref>Hass, Jeffrey. "[http://www.indiana.edu/%7Eemusic/etext/MIDI/chapter3_MIDI3.shtml Chapter Three: How MIDI works 3] {{webarchive|url=https://web.archive.org/web/20150619160322/http://www.indiana.edu/~emusic/etext/MIDI/chapter3_MIDI3.shtml |date=19 June 2015 }}". Indiana University Jacobs School of Music. 2010. Web. 13 August 2012.</ref> Channel Voice messages transmit real-time performance data over a single channel. Examples include ''note-on'' messages which contain a MIDI note number that specifies the note's pitch, a velocity value that indicates how forcefully the note was played, and the channel number; ''note-off'' messages that end a note; program change messages that change a device's patch; and control changes that allow adjustment of an instrument's parameters. MIDI notes are numbered from 0 to 127 assigned to C<sub>β1</sub> to G<sub>9</sub>. This extends beyond the 88-note piano range from A<sub>0</sub> to C<sub>8</sub> and corresponds to a frequency range of 8.175799 to 12543.85 Hz.{{efn|Assuming equal temperament and 440 Hz A<sub>4</sub>}} ====System Exclusive messages {{anchor|SysEx}}==== System Exclusive ('''SysEx''') messages send information about a synthesizer's functions, rather than performance data such as which notes are being played and how loud. Because they can include functionality beyond what the MIDI standard provides, they are a major reason for the flexibility and longevity of the MIDI standard. Manufacturers use them to create proprietary messages that control their equipment more thoroughly than the limitations of standard MIDI messages.<ref name="Manning3" />{{rp|287|date=November 2012}} The MIDI Manufacturers Association issues a unique identification number to MIDI companies.<ref>{{Cite web |title=Request SysEx ID |url=https://www.midi.org/request-sysex-id |url-status=live |archive-url=https://web.archive.org/web/20210923085555/https://www.midi.org/request-sysex-id |archive-date=2021-09-23 |access-date=2023-10-06 |website=[[MIDI Manufacturers Association]]}}</ref> These are included in SysEx messages, to ensure that only the specifically addressed device responds to the message, while all others know to ignore it. Many instruments also include a SysEx ID setting, so a controller can address two devices of the same model independently.<ref>Hass, Jeffrey. "[http://www.indiana.edu/%7Eemusic/etext/MIDI/chapter3_MIDI9.shtml Chapter Three: How MIDI works 9] {{webarchive|url=https://web.archive.org/web/20150607074022/http://www.indiana.edu/%7Eemusic/etext/MIDI/chapter3_MIDI9.shtml |date=7 June 2015 }}". Indiana University Jacobs School of Music. 2010. Web. 13 August 2012.</ref> ''Universal'' System Exclusive messages are a special class of SysEx messages used for extensions to MIDI that are not intended to be exclusive to one manufacturer.<ref>{{Cite web |title=MIDI 1.0 Universal System Exclusive Messages |url=https://www.midi.org/specifications-old/item/table-4-universal-system-exclusive-messages |url-status=live |archive-url=https://web.archive.org/web/20230721230039/https://www.midi.org/specifications-old/item/table-4-universal-system-exclusive-messages |archive-date=2023-07-21 |access-date=2023-10-06 |website=[[MIDI Manufacturers Association]]}}</ref> ====Implementation chart==== Devices typically do not respond to every type of message defined by the MIDI specification. The MIDI implementation chart was standardized by the MMA as a way for users to see what specific capabilities an instrument has, and how it responds to messages.<ref name="Huber 1991" />{{rp|231|date=November 2012}} A populated MIDI implementation chart is usually published as part of the documentation for MIDI devices. ===Electrical specifications=== MIDI 1.0's electrical interface is based around a fully isolated [[current loop]]<ref name="MIDI specification" /> along the red and blue lines in the following [[Circuit diagram|schematic]]: [[File:MIDI IN OUT simplified schematic twisted-pair.svg|alt=MIDI interconnection schematic|center|718x718px]] "DIN / TRS" in this schematic indicates that either a [[DIN connector]]{{Efn|The original MIDI 1.0 specification mandated DIN-5. The current source pin or hot pin ("H" in this schematic) corresponds to pin 4 of a 5-pin DIN. The current sink or cold pin ("C" in this schematic) corresponds to pin 5 of that DIN. The shield pin ("S" in this schematic) corresponds to pin 2 of that DIN.}} or a [[TRS phone connector]]{{Efn|Three variants on how to use TRS phone connectors are called ''Type A'', ''Type B'', and ''TS'' (a.k.a. ''Type C'' or ''Non-TRS''). ''Type A'' became part of the MIDI standard in 2018. ''Type A'' pin assignments are: the current source or hot pin ("H" in the schematic) is ring of the TRS, the current sink or cold pin ("C" in the schematic) is the tip of the TRS, and the shield ("S" in the schematic) is the sleeve of the TRS.}} may be used.<ref>{{Cite web |title=[Updated] How to Make Your Own 3.5mm mini stereo TRS-to-MIDI 5 pin DIN cables |url=https://www.midi.org/midi-articles/updated-how-to-make-your-own-3-5mm-mini-stereo-trs-to-midi-5-pin-din-cables |access-date=2023-12-14 |website=The MIDI Association |language=en-gb |archive-date=14 December 2023 |archive-url=https://web.archive.org/web/20231214070734/https://www.midi.org/midi-articles/updated-how-to-make-your-own-3-5mm-mini-stereo-trs-to-midi-5-pin-din-cables |url-status=live }}</ref><ref>{{Cite web |title=A simplified guide to MIDI over TRS minijacks β minimidi.world |url=https://minimidi.world/ |access-date=2023-12-14 |website=minimidi.world |archive-date=14 December 2023 |archive-url=https://web.archive.org/web/20231214070735/https://minimidi.world/ |url-status=live }}</ref> To transmit a logic 0 and a start bit, the sender's [[UART]]{{Efn|Universal Asynchronous Receiver/Transmitter ([[UART]]) is hardware that transports bytes between digital devices. When MIDI was new, most synthesizers used discrete, external UART chips, such as the [[8250]] or [[16550 UART]], but UARTs have since moved into [[microcontrollers]].<ref name=SparkFun>{{Cite web |title=MIDI Tutorial - SparkFun Learn |url=https://learn.sparkfun.com/tutorials/midi-tutorial/hardware--electronic-implementation |access-date=2023-12-15 |website=[[SparkFun]] |archive-date=15 December 2023 |archive-url=https://web.archive.org/web/20231215011929/https://learn.sparkfun.com/tutorials/midi-tutorial/hardware--electronic-implementation |url-status=live }}</ref>}} produces a low voltage. This results in a nominal 5 [[milliampere]]s<ref name="MIDI specification" /> current flow [[Current source|sourced]] from the sender's high voltage supply,{{efn|1=MIDI nominally uses a +5 volt source, in which case the resistance assignments are R1=R2=R4=220[[Ohm|Ξ©]] and R3=280Ξ©. But it is possible to change the resistance values to achieve a similar current with other voltage supplies (in particular, for 3.3 volt systems).}} which travels rightwards along the red lines though the [[Shielded cable|shielded]]{{Efn|The MIDI specification provides for a ground "wire" and a braid or foil shield, connected on the Shield pin, protecting the two signal-carrying conductors on the Hot and Cold pins. Although the MIDI cable is supposed to connect this Shield pin and the braid or foil shield to chassis ground, it should do so only at the MIDI out port; the MIDI in port should leave its Shield pin unconnected and isolated. Some large manufacturers of MIDI devices use modified MIDI in-only DIN 5-pin sockets with the metallic conductors intentionally omitted at pin positions 1, 2, and 3 so that the maximum voltage isolation is obtained.}} [[twisted-pair]] cable and into the receiver's opto-isolator. The current exits the opto-isolator and returns back leftwards along the blue lines into the sender's UART, which [[Current sink|sinks]] the current.{{Efn|It is often easier to use [[NPN transistor|NPN]] or [[Field-effect_transistor#n-channel_FET|nMOS]] transistors to ''sink'' current than to use [[PNP transistor|PNP]] or [[Field-effect_transistor#p-channel_FET|pMOS]] transistors to ''source'' current, because [[electron mobility]] is better than hole mobility.}} [[Resistors]] R1 and R2 limit the current and are equal to provide a [[Balanced line|balanced impedance]]. The [[diode]] is for protection.<ref>{{Cite journal |last=Russ |first=Martin |date=1988-01-01 |title=Practically MIDI (SOS Jan 1988) |url=https://www.muzines.co.uk/articles/practically-midi/3458 |journal=Sound on Sound |issue=Jan 1988 |pages=56β59 |access-date=14 December 2023 |archive-date=14 December 2023 |archive-url=https://web.archive.org/web/20231214192852/https://www.muzines.co.uk/articles/practically-midi/3458 |url-status=live }}</ref> This current turns on the opto-isolator's{{efn|MIDI's original reference design uses the obsolete [[Sharp Corporation|Sharp]] PC900, but modern designs frequently use the 6N138.<ref name="SparkFun" /> The opto-isolator provides [[galvanic isolation]], so there is no conductive path between the two MIDI devices. Properly designed MIDI devices are therefore relatively immune to ground loops and similar interference.}} [[LED]] and [[phototransistor]], so the receiver's UART can read the signal with the help of [[pull-up resistor]] R3 to the receiver's voltage supply. While the supplies in the original specification are 5 [[volts]], the receiver and sender may use different voltage levels. To transmit a logic 1, a stop bit, and while idle, the sender's [[UART]] produces the same high voltage as its [[Voltage source|voltage supply]] provides, which results in no current flow. This avoids wasting power when idle.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
MIDI
(section)
Add topic