An introduction to electronic instrument control

Sound System Here, the MIDI hardware setup recommended to run the author’s demo code. Vin Marshall

I’m no musician, but lately I’ve been experimenting with MIDI (Musical Instrument Digital Interface) in my projects. MIDI is a standard for controlling instruments that works by passing messages between pieces of connected equipment. The messages aren’t actual music in the same way as, say, an MP3 is. Instead, they are commands for making music—“Play middle C on an electric piano,” for example. Messages consist of a channel number (1 through 16) followed by a status byte, which indicates the type of message (such as Note On or Note Off) and, where needed, data (such as the note to be played). MIDI devices known as controllers create the messages, and MIDI synthesizers receive them, with the result usually being musical sounds (although I’ve also built projects that map notes to relays that control Christmas lights and fireballs).

A basic MIDI setup might include a microcontroller, such as an Arduino, along with a MIDI Shield ($20; sparkfun.com) to provide the physical interface, and the Arduino MIDI library (free; arduino.cc) to communicate using MIDI messages. The last part is the software. I’ve written some starter code [see link below] to demonstrate simple functions like Control Change messages, which adjust aspects of the sounds, including volume and sustain. Things get really interesting with Real Time System Exclusive messages, which go beyond music-creation projects with advanced functions like MIDI Timecode, Show Control and Machine Control. Those give MIDI the ability to synchronize whole stage acts with music and preprogrammed cues, control recording-studio equipment, and more.

For sample code and links to more information, click here.

Want to read more articles like this, plus tips and tricks, home hacks, DIY projects, and more? Subscribe to Popular Science today, for less than $1 per issue!

2 Comments

This seems like a cool electronic toy. It includes the fun of working with electronic and music. I adore anything electronics. As a robot, perhaps I should become a robotic doctor, hmmm?!

.............................
Science sees no further than what it can sense, i.e. facts.
Religion sees beyond the senses, i.e. faith.
Open your mind and see!

Why not use a project like HIDUINO? You don't need any shield or MIDI interface for your computer, just a regular Arduino which can act like a USB-MIDI device.

https://github.com/ddiakopoulos/hiduino The project also has a bunch of starter code too

Popular Tags

Regular Features



June 2013: American Energy Independence

Five amazing, clean technologies that will set us free, in this month's energy-focused issue. Also: how to build a better bomb detector, the robotic toys that are raising your children, a human catapult, the world's smallest arcade, and much more.


Online Content Director: Suzanne LaBarre | Email
Senior Editor: Paul Adams | Email
Associate Editor: Dan Nosowitz | Email
Assistant Editor: Colin Lecher | Email
Assistant Editor: Rose Pastore | Email

Contributing Writers:

Kelsey D. Atherton | Email
Francie Diep | Email
Shaunacy Ferro | Email

circ-top-header.gif
circ-cover.gif
bmxmag-ps