MIDI

The educational technology and digital learning wiki
Jump to navigation Jump to search

Draft

Introduction

“MIDI (Musical Instrument Digital Interface, pronounced /ˈmɪdi/) is an industry-standard protocol defined in 1982[1] that enables electronic musical instruments such as keyboard controllers, computers, and other electronic equipment to communicate, control, and synchronize with each other. MIDI allows computers, synthesizers, MIDI controllers, sound cards, samplers and drum machines to control one another, and to exchange system data (acting as a raw data encapsulation method for sysex commands). MIDI does not transmit an audio signal or media — it transmits "event messages" such as the pitch and intensity of musical notes to play, control signals for parameters such as volume, vibrato and pa” (Musical Instrument Digital Wikipedia, retrieved 10:04, 26 May 2009 (UTC))

In more practical terms, with midi you can:

  • Register what you played on a synthesizer, e.g. an electronic keyboard, with a symbolic language (MIDI).
  • Play MIDI files on a synthesizer, i.e. an electronic instrument such as a keyboard, but also computer or mobile devices sound cards.
  • Write computer programs that generate midi sounds (e.g. in instructional applications or computer games).

The advantage of using midi formats in educational technology and computer games, are twofold. Midi files take little space and sounds can be dynamically generated with relative ease.

File formats

Standard Midi

Standard Midi File (SMF) include the following information:

  • Tracks with music (sounds) that are played on channels
  • Each sound can have extra information about how it should be played

More technicall speaking, MIDI defines messages:

  • MIDI messages include an eith-bit status byte plus one or two data bytes
  • The most important MIDI messages are Channel messages.
  • Channel messages are either Channel Voice messages (sounds) or Mode Messages that define how the instrument will play the sound.

General Midi

“General MIDI or GM is a standardized specification for music synthesizers that respond to MIDI messages. [...] GM imposes several requirements beyond the more abstract MIDI 1.0 specification. While MIDI 1.0 by itself provides a protocol which ensures that different instruments can interoperate at a fundamental level (e.g. that pressing keys on a MIDI keyboard will cause an attached MIDI sound module to play musical notes)” (Wikipedia, retrieved 10:04, 26 May 2009 (UTC)).

GM was introduced in 1991, and is today a minimalist standard that ought be supported by most devices.

GM-compatible devices (e.g. synthesizers and sound-cards) are required to be able to:

  • Define instrument sounds for each of the 128 possible program numbers. (Sometimes numbered between 0 and 127). These sounds or programs can then be associated with a channel. One channel can hold more than one track (!)
  • Allow 24 voices to be active simultaneously (including at least 16 melodic and 8 percussive voices)
  • Support 16 channels simultaneously (with channel 10 reserved for percussion)
  • Support polyphony (multiple simultaneous notes) on each channel
  • Controlling information for a sound: sound on/off, amount of modulation, overal volume, left-right pan, expression, sustain

General MIDI 2

Introduced in 1999, this specification extends General MIDI, e.g. with a larger instruments palette, additional control messages, etc.

Downloadable Sounds (DLS)

“DLS is a family of standardized file formats for digital musical instrument sound banks (collections of virtual musical instrument programs). The DLS standards also include detailed specifications for how MIDI protocol-controlled music synthesizers should render the instruments in a DLS file.” (Wikipedia, retrieved 10:04, 26 May 2009 (UTC).

eXtensible Music Format ("XMF")

“The Extensible Music Format (XMF) is a tree-based digital container format used to bundle music-oriented content, such as a MIDI file and optionally the sounds it uses, liner notes or other content grouped by language-codes.” (Wikipedia, retrieved 10:04, 26 May 2009 (UTC).)

Mimetypes

Midi files: Type: audio/midi (or sometimes audio/x-midi ?) File extensions: mid, midi, kar

DLS: RFC 4613 Type: audio/dls File extensions: dls

XMF: RFC 4723 Type: audio/mobile-xmf File extensions: xmf

Inclusion of midi in web pages

A minimal solution is the following:

Depending on the browser, this may load a new page.

If you want embedded controls for the user:

  • Use the embedd tag, e.g. like this
<embed src="http://tecfa.unige.ch/themes/FAQ-FL/son_dans_pageWEB/allegro.mid"
       align="baseline" border="0" controls="smallconsole" 
       autostart="true" loop="2"/>

Note: Will not work in this wiki, since we don't allow the embedd tag.

In principle, one also could use the "object" tag, but sometimes it's not implemented.

There exist also JavaScript wrappers to deal with various browser and plugin combos.

Hardware

Sound Cards

Most sound cards should be able to play MIDI directly if some player software like QuickTime is installed.

If your sound card doesn't handle midi, you can try a software synthesizer such as TiMidity++.

Software

For users
  • Quicktime and Windows Media player can play MIDI.
  • See the Playing MIDI files article on Wikipeida]
  • MIDI STUDIO MAX. A JavaScript program to make it work on Windows for various browsers + Windows Media player.
Multimedia development

Links

Some Wikipedia entries

Wikipedia includes several articles on MIDI standards, in particular:

Tutorials
Repositories
  • freemidi.com Software for midi and karaoke and index of midi file sites
Technical infos