Musical Carrion
This is the place where good music goes to die. All of the content (including audio tracks) provided here may be freely distributed in full as long as correct attribution is made.

Useless Poll #56

You are here because:
You're lost
Morbid fascination
Result of lost bet
Butt of cruel joke

Looking for Matt? Try this site, His Music MySpace page or Personal MySpace page. Or you could call him on +1 408 338 7172.

Valid XHTML 1.0 Strict

Valid CSS!

MIDI Reactor

Overview

As a guitarist (and I'm sure many of you are the same), I find it frustrating to have to use a keyboard or a mouse to perform many tasks, such as initiating a session allowing you to overdub a new part over an existing set of tracks. You've always got an instrument between you and the keyboard and the whole situation is a pain.

I'm certain I'm not the first person to have come across this problem. However, I'm not sure what real musicians, engineers and normal people do to solve the problem. Rather than ask a few people, I thought it easier to write some code. :-)

The project, currently called MIDI Reactor, fits my needs quite well. It may have already been done and may be the worst idea since the Australia-US Free Trade Agreement in 2005, but I'll keep try to keep this info up to date. That way, on the off-chance that it actually helps someone outside my head, it's available to the you all. Comments and feedback always more than welcome. Send them to midireactor at musicalcarrion.com.

Overview of MIDI

MIDI, for those who have managed to avoid it, is not a PCM audio format in the same way a WAVE, MP3 or Ogg Vorbis files are. Instead, MIDI describes how an instrument is played using a set of signals that relate to various properties of music. For example, the note-on and note-off signals are used to describe a note being played and released (think about hitting and releasing a key on a piano). Other properties such as the velocity at which the note is struck are also included.

A MIDI sequencer can take these MIDI signals or events and turn them into an audio stream. A well-known and flexible software sequencer is Timidity++, which can combine these MIDI events and a collection of digital samples called a soundfont, and make noise.

In addition to performance-related signals, MIDI also has a number of control signals. Signals such as program changes and controller changes affect certain parameters of certain MIDI devices. A program change signal may tell a MIDI keyboard to change instruments to a church organ, or a controller change may alter the volume of a guitar effects processor.

MIDI Reactor

The general idea behind MIDI reactor is to use incoming MIDI events to trigger other software events. Consider the following example:

  1. I tap a switch on my MIDI foot controller (for example, a Behringer FCB1010)
  2. The foot switch sends a program change signal over the MIDI bus
  3. MIDI Reactor matches that signal against a list of signals to watch for
  4. MIDI Reactor dispatches the corresponding software commands, in this case...
  5. ... Starting ecasound with a pre-defined chainsetup that begins to capture digital audio from a given sound device
  6. I then play
  7. I tap another switch, which sends a signal to MIDI Reactor, which causes it to stop recording
  8. After hitting a third switch, MIDI Reactor starts ecasound again, but this time the chainsetup is configured to capture digital audio and play back the previous track at the same time.
  9. I continue to play and screw something up
  10. A fourth button could be pressed on the foot controller, which causes MIDI Reactor to stop ecasound, rewind to the start and start recording/playing again.
  11. And so on

The general idea is that MIDI Reactor sees MIDI events coming in from the MIDI bus and triggers other events in software. Many Linux/UNIX applications could be triggered and controlled in this fashion. All of this can, in the case of a foot controller, be controlled with, errr, your feet.

Source code

There's nothing to see yet. I've got a lump of C that I'm messing about with at the moment. I'll post it when it's a little more configurable.

Author: Matthew Geddes 13/01/2006