Vol. 07: MIDI Control
Music equipment language isn't just for audio anymore.
By Peter Kirn
Read this article now in your digital edition!
Subscribe to MAKE and get the best rate!
+ Downloads & Extras:
Primer: Midi Control, Additional Resources
Nearly all music creation applications support MIDI. General-purpose recording and editing software or DAWs (digital audio workstations) like Pro Tools, Ableton Live, Apple Logic and GarageBand, Cakewalk SONAR, the open-source software Rosegarden, and many others have built-in MIDI recording and editing facilities. Software instruments, drum machines, and so on all support MIDI because they have to; without MIDI you couldn't play them as instruments. But MIDI support isn't limited to these applications: many VJ and live video applications, such as motion dive .tokyo (distributed by Edirol), Resolume, Arkaos VJ, and Vidvox Grid also support MIDI input for control and live visuals. MIDI has even found its way into some 3D applications, including Maya.
If you're not happy with any of these options, you can build your own MIDI application. Without writing a single line of code, you can create extensive tools using visual patcher environments like Cycling '74's Max/MSP and the open source Pure Data (also known as 'Pd,' a free cousin of Max/MSP by Max's original creator), among others. DIY software environments are ideal if you want to go beyond conventional music applications: tools like Isadora focus primarily on video and graphics, and Max/MSP and Pd are capable of controlling hardware, robotics, video, and 3D imagery. (Unfortunately, Adobe's Flash, which would otherwise be ideal for some of these features, doesn't natively support MIDI input.) If you're comfortable with programming, you can code your own MIDI applications. The open-source multimedia environment Processing can be extended with an optional library for MIDI, or you can code a whole application. Apple's Mac OS X has a significant set of MIDI features built into the operating system, with a whole selection of sample Core MIDI code and tools installed with its developer tools.
DIY software applications let you patch together your own custom MIDI applications for a variety of multimedia possibilities, not at all limited to music. Here are just a few examples:
- Max/MSP, Cycling '74, http://www.cycling74.com (commercial, Mac/Windows)
- Pure Data (ìPdî), http://puredata.org (open source/free, Mac/Windows/Linux/Other)
- Isadora, TroikaTronix, http://www.troikatronix.com (commercial, Mac/Windows)
- Processing, http://processing.org, (open source/free, Mac/Windows/Linux), extended by the proMIDI library (http://www.texone.org/promidi/)
You'll also want some basic tools for monitoring, managing, and troubleshooting MIDI messages. The following are all must-haves and free/donationware:
- Windows: MIDI-OX and MIDI-Yoke, http://www.midiox.com
- Mac: MidiPipe, http://homepage.mac.com/nicowald/SubtleSoft/
- Mac: MIDI Monitor, http://www.snoize.com/MIDIMonitor/
- Linux: At the AlsaModularSynth page, http://alsamodular.sourceforge.net, you'll find a number of handy MIDI utilities such as QMidiRoute and QmidiControl
MIDI hardware is even more application-agnostic than MIDI software, because as long as you ignore the labels on the knobs and faders, you can use MIDI devices for whatever you want. Some have standard MIDI ports, some have USB or FireWire connections for computers, and many these days have both. Keyboards were among the first MIDI hardware and still make up a big chunk of the market, but the need to control computer software with something more useful than a keyboard has led to lots of knob- and fader-covered control surfaces, hardware designed for use with live visual apps and VJ performances, virtual turntables for scratching, MIDI wind instruments, MIDI guitars, MIDI drums, foot pedals, wireless controllers, and even MIDI accordions. MIDI can also be found on some light boards, and other control specifications used for lighting, like DMX, can be interfaced with MIDI using an adapter. (LanBox, http://www.lanbox.com, is a particularly useful vendor for MIDI-to-DMX products suitable for installations as well as theatrical applications.)
MIDI hardware is generally oriented toward performance, but what that performance is can be entirely up to you. If you enjoy playing a MIDI wind instrument but would rather control video than make sound, you can; just select the port for the device you want to use in any software that supports MIDI input.
If off-the-shelf hardware doesn't provide quite the combination of knobs you want, or if you want to go beyond controls like keys and faders entirely, there's the option of building your own hardware. There's a growing scene of DIY MIDI hardware builders, which tend to fall into two basic camps. If you're interested in unusual interfaces using sensors, wireless gyroscopes, MIDI-generating jackets and gloves, and the like, there are a variety of ìphysical computingî, sensor-to-MIDI boards and kits. If you just want to build something with buttons, knobs, faders, and other more conventional controllers, you may be better off with a MIDI kit designed for that purpose.
DIY Hardware Resources
Several vendors make ready-to-build kits for building your own instruments and MIDI gear; they're usually a better bet than trying to source all the components yourself:
- PAiA Electronics, Inc., the legendary supplier of audio and MIDI kits, http://www.paia.com/
- uCApps.de, free DIY MIDI projects embraced by an enthusiastic community of builders, http://www.ucapps.de
- Doepfer Electronics Pocket Electronic, the perfect starting point for any DIY MIDI controller, http://www.doepfer.de/home_e.htm
If you're more interested in creating physical computing applications and experimenting with different sensors as MIDI inputs, there are pre-built I/O boards built for the purpose, ranging from inexpensive boards for which you bring your own sensors (the MIDIsense and MidiTron) to more expensive 'sensor system' options built into cases with optional sensor supplies:
- MidiTron, http://eroktronix.com/
- MIDIsense, http://www.ladyada.net/make/midisense/
- I-CubeX, http://infusionsystems.com/
- Eobody, http://www.eowave.com/
As a more general physical computing reference, you'll also want to refer to Physical Computing: Sensing and Controlling the Physical World with Computers (Course Technology PTR, 2004) and co-author (and Make contributor) Tom Igoe's site, http://itp.nyu.edu/~tqi6023/
Behind the Scenes: Anatomy of a MIDI Message
Most MIDI messages have values between 1 and 128 (or between 0 and 127). The reason for the recurrence of the number 128 is that MIDI transmits all the data it needs in single byte-sized pieces.
Bytes are the second-smallest basic data measure. Bits are smallest, containing only a 0 or 1; a MIDI byte has ten bits (ten zeros or ones), but only eight of them contain data. (The other two are a start bit and a stop bit.) In addition, the first bit in an eight-bit MIDI byte is reserved for determining whether the byte is a status byte or a data byte. This leaves seven bits for each data byte. Since each bit contains either a 1 or a 0 (two possible values), the number of possible data bytes is 2 to the 7th power, or 128.
Most MIDI messages contain three bytesóa status byte followed by two data bytes. Here's how such a message breaks down:
- Status byte: Describes the kind of message and the channel for which the message is intended. Notes, control changes, and program changes are all different message types, so they use different status bytes. For instance, the status byte might indicate "here's a played note on channel 14." At this point, the note that was struck is still unknown.
- First data byte: The number after the status byte, which can range from 0 to 127, provides more information. If the status byte is a note-on, the first data byte indicates the note number, such as 60 for Middle C.
- Second data byte: The third and last number, which again can range from 0 to 127, either adds more detail to the first data byte or provides some other related piece of information. If the status byte is a note-on, the first data byte provides a note number to specify which key was struck, and the second data byte describes the velocity (speed) with which the key was struck. For instance, the complete three-byte message might specify that Middle C on channel 14 was played with a velocity value of 64, which would be a medium amount of force. Note that a few MIDI messages, notably channel pressure (defined later in this sidebar), don't have a second data byte. They're two-byte messages (one status byte and one data byte).
Inside the actual MIDI messages, all three data bytes are binary (strings of zeros and ones). Programmers usually work with this data in the hexadecimal numeral system, which represents numbers as pairs of six letters (A-F) and ten numbers (0-9). For instance, the decimal number 26 becomes 1A in hexadecimal. Most software will convert to decimal numbers or MIDI message descriptions, so you probably won't need the hex numbers unless you're programming a microcontroller.
Here's an example of a MIDI message: press the note E4 and you generate three numbers:
144 52 42
The first number (status byte, 144) indicates note-on, channel 1. The second number (first data byte, 52) is the note number E4. The third number (second data byte, 42) is the velocity, how hard the E was hit.
Since all MIDI messages must begin with a status byte, messages can be categorized technically according to the different status bytes:
- Key pressure (sometimes called poly aftertouch or poly pressure)
- Channel pressure (more commonly called aftertouch; the pressure after a note is played)
"Anatomy of a MIDI Message" excerpted from Real World Digital Audio by Peter Kirn. Copyright © 2006 Peter Kirn. Used with the permission of Pearson Education, Inc. and Peachpit Press. All rights reserved.
» MAKE: NOISE — Discuss this articleYou must be logged in to post a talkback.
[ Display main threads only] [ Oldest First]
Showing messages 1 through 2 of 2.
Full article in the magazine
You must be logged in to reply.
This isn't the full article; it's a Web supplement. The full article covers more on MIDI and various unusual projects built using MIDI, not only the data glove but a few others.
If you're interested in the specific workings of data gloves and other devices that use bend sensors, though, I think you'll like the tutorial in MAKE 08, about to hit newsstands.
Posted by peterkirn on November 05, 2006 at 12:34:59 Pacific Time
Data Glove ?
You must be logged in to reply.
What a fiddle ! I was expecting an article on the dataglove not Midi.
Posted by firstname.lastname@example.org on November 05, 2006 at 09:03:34 Pacific Time
Showing messages 1 through 2 of 2.
Join the conversation -- every MAKE article has an online page that includes a place for discussion. We've made these RSS and Atom feeds to help you watch the discussions: subscribe.