Skip to content

Introduction to MIDI

Sara Adkins edited this page Jan 8, 2017 · 9 revisions

##What is MIDI? MIDI(Music Instrument Digital Interface) is a technical standard that allows computer equipment to quickly communicate musical data. MIDI works by sending a MIDI message(encoded as an integer) to a computer or digital instrument that then interprets the message and (usually) outputs sound based on the message it receives. By sending MIDI messages to a digital instrument(in our case robotic instruments) we can easily control the music RobOrchestra plays.

##Types of MIDI Messages There are several different types of MIDI messages, which are all commonly used to control synthesizers. For the purposes of RobOrchestra we care about primarily about two types of messages: the NoteOn message and the NoteOff message. Details about how messages are encoded can be found in Dave's MIDI Spec. ###NoteOn Message A noteOn message is composed of 3 components: channel, pitch and velocity. By sending a noteOn message, we are telling the robot receiving the message to immediately play the note specified.

  • Channel: When sending a noteOn message, we use the channel parameter to specify which robot we want to play the note. Each robotic instrument is programmed to accept MIDI messages from its specific channel. The channel parameter must be an integer 0-15
  • Pitch: This parameter is used to tell the robot which pitch to play. This parameter is represented as an integer. Use the MIDI Pitch Table to translate a note name(C4, E3 etc.) to its corresponding MIDI pitch value. For percussion robots, each type of drum has a corresponding "pitch" value as defined in the Percussion Pitch Table
  • Velocity: The velocity value corresponds to volume, and is represented by an integer 0-127. This parameter specifies how loud to play a note, but most RobOrchestra instruments ignore this parameter.

###NoteOff Message A noteOff message specifies that a previously sent noteOn message should stop playing. Without this message type, all notes would play forever! A noteOff message has the same 3 parameters as a noteOn message, but the velocity value MUST be set to 0. When "turning off" a note, be sure to use the same channel the note was turned on with.

Clone this wiki locally