User Tools

Site Tools


midi_specification

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
midi_specification [2006/06/30 00:15]
admin corrections and improvements
midi_specification [2012/10/02 06:42] (current)
cheater Reverting spam from lauraholden
Line 1: Line 1:
 ====== MIDI Specifications ====== ====== MIDI Specifications ======
 +
 +If you'd like a simplified explanation,​ see [[http://​www.midibox.org/​dokuwiki/​simple_midi_specification|here]]... Otherwise this page contains some more technical info.
  
 [[MIDI]] is a standardized way for the communication between musical devices. It specifies the physical interface as well as the transmission protocol. There are different types of MIDI messages, for a full list please follow the links below. ​ [[MIDI]] is a standardized way for the communication between musical devices. It specifies the physical interface as well as the transmission protocol. There are different types of MIDI messages, for a full list please follow the links below. ​
Line 11: Line 13:
 MIDI bytes are mostly displayed in hexadecimal form to simplify the reading. Therefore we will continue with this value format below, and won't mention the appr. decimal values anymore. MIDI bytes are mostly displayed in hexadecimal form to simplify the reading. Therefore we will continue with this value format below, and won't mention the appr. decimal values anymore.
  
-Status bytes in the range of 0x80..0xEF contain a channel information,​ which allow to address up to 16 different listeners, or multiple listeners at the same time. The MIDI channel is located within the first 4 bits of the status byte.+Status bytes in the range of 0x80..0xEF contain a channel information,​ which allow to address up to 16 different listeners, or multiple listeners ​which are listen ​at the same time when they are listining the same channel. The MIDI channel is located within the first 4 bits of the status byte.
  
 For Example: For Example:
Line 35: Line 37:
 F identifies a System Message which either addresses all listeners (there is no MIDI channel), or which addresses dedicated MIDI devices which are parsing for a SysEx (System Exclusive) stream. F identifies a System Message which either addresses all listeners (there is no MIDI channel), or which addresses dedicated MIDI devices which are parsing for a SysEx (System Exclusive) stream.
  
-E.g., MIOS "feels addressed"​ on SysEx messages which are starting with 0xF0 0x00 0x00 0x7E 0x40, followed by data byte which selects the device (Device ID), followed by a command to the operating system (e.g. Code Upload). +E.g., MIOS "feels addressed"​ on [[SysEx]] messages which are starting with 0xF0 0x00 0x00 0x7E 0x40, followed by data byte which selects the device (Device ID), followed by a command to the operating system (e.g. Code Upload). 
-SysEx messages should be finished with 0xF7, thereafter any other MIDI event can be sent again.+[[SysEx]] messages should be finished with 0xF7, thereafter any other MIDI event can be sent again.
  
 The last Status Bytes within the range of 0xF8..0xFF - also called "​Realtime messages"​ - have (again) a special purpose, because it's allowed to send them at any time, even in between any other MIDI message without violating the protocol. ​ The last Status Bytes within the range of 0xF8..0xFF - also called "​Realtime messages"​ - have (again) a special purpose, because it's allowed to send them at any time, even in between any other MIDI message without violating the protocol. ​
Line 42: Line 44:
 A typical realtime message is the MIDI clock 0xF8 - since it is allowed to send the clock at any time, regardless of the currently sent stream - the achievable latency is very low. In addition, realtime messages don't change the running status - more about this topic (status byte can be omitted if the same one was sent before) can be read in the MIDI spec. A typical realtime message is the MIDI clock 0xF8 - since it is allowed to send the clock at any time, regardless of the currently sent stream - the achievable latency is very low. In addition, realtime messages don't change the running status - more about this topic (status byte can be omitted if the same one was sent before) can be read in the MIDI spec.
  
 +
 +\\
 +\\
 +
 +====== Programming Examples ======
  
 At the end some practical informations for MIOS programmers (examples are written in [[C]]): At the end some practical informations for MIOS programmers (examples are written in [[C]]):
Line 90: Line 97:
   MIOS_MIDI_TxBufferPut(0x3c);​ // Note number for C-3   MIOS_MIDI_TxBufferPut(0x3c);​ // Note number for C-3
   MIOS_MIDI_TxBufferPut(0x7f);​ // velocity   MIOS_MIDI_TxBufferPut(0x7f);​ // velocity
-  MIOS_MIDI_TxBufferPut(0x30); // Note number for E-3+  MIOS_MIDI_TxBufferPut(0x40); // Note number for E-3
   MIOS_MIDI_TxBufferPut(0x60);​ // velocity   MIOS_MIDI_TxBufferPut(0x60);​ // velocity
-  MIOS_MIDI_TxBufferPut(0x33); // Note number for G-3+  MIOS_MIDI_TxBufferPut(0x43); // Note number for G-3
   MIOS_MIDI_TxBufferPut(0x40);​ // velocity   MIOS_MIDI_TxBufferPut(0x40);​ // velocity
   MIOS_MIDI_EndStream();​   MIOS_MIDI_EndStream();​
Line 98: Line 105:
  
  
 +\\
 +\\
 +
 +====== 14-bit MIDI Messages ======
 +
 +There are two ways to use 14-bit MIDI Messages; the trick is, to combine two 7-bit Messages to one 14-bit:
 +<code c>
 +unsigned int MSB  = 127 << 7; // 16256
 +unsigned char LSB = 127; // 127
 +unsigned int largeNumber = MSB + LSB; // 16383:
 +</​code>​
 +  * using RPNs
 +  * using NRPNs: <code c>
 +CC98 01100010 0x62 Non-Registered Parameter Number (NRPN) - LSB 0-127 LSB
 +CC99 01100011 0x63 Non-Registered Parameter Number (NRPN) - MSB 0-127 MSB
 +</​code>​
 +  * sending two Controller Messages, eg:<​code>​
 +CC 12, Effect Ctrl 1 (MSB = Most Significant Byte)
 +CC 44, Effect Ctrl 1 (LSB = Least Significant Byte)</​code>​
 +
 +Sending 14bit from one pot is only possible if you're hacking the code. Because Pots are being read as 10-bit value, you have to interpolate to 14 bit and implement a NRPN or dual-CC method.
 +
 +Further informations:​ \\
 +[[http://​home.roadrunner.com/​~jgglatt/​tech/​midispec.htm|Jglatt'​s Technical MIDI Specs Page]] or \\
 +[[http://​www.midi.org/​about-midi/​table3.shtml|Table 3: Summary of Control Change Messages (Data Bytes)]] for further examples and explanations
 +
 +
 +\\
 +\\
 +
 +====== Tools & Helpers ======
 +
 +[[ACMidiDefines]] – a definition listing to access Midi Events by Name
 +
 +
 +\\
 +\\
 +====== More Informations ======
  
 More informations can be found online:\\ More informations can be found online:\\
  
-  * [[http://www.borg.com/~jglatt|MIDI Technical Fanatic'​s Brainwashing Center]] <​sup>​must-read!</​sup>​\\ +  * [[http://home.roadrunner.com/~jgglatt/|MIDI Technical Fanatic'​s Brainwashing Center]] <​sup>​must-read!</​sup> ​[[http://​web.archive.org/​web/​20070813201804/​www.borg.com/​~jglatt/​|Archive]]\\ 
-  * [[http://www.borg.com/~jglatt/​tech/​midispec.htm|Jglatt'​s Technical MIDI Specs Page]]\\+  * [[http://home.roadrunner.com/~jgglatt/​tech/​midispec.htm|Jglatt'​s Technical MIDI Specs Page]] [[http://​web.archive.org/​web/​20070820161159/​http://​www.borg.com/​~jglatt/​tech/​midispec.htm|Archive]]\\
  
  
midi_specification.1151626513.txt.gz · Last modified: 2006/10/15 09:35 (external edit)