Finding the Logic in MIDI Editing

When it comes to editing MIDI tracks, logical edit utilities are often used as a last resort. Because logical edit utilities are harder to understand

When it comes to editing MIDI tracks, logical edit utilities are often used as a last resort. Because logical edit utilities are harder to understand and to use than, for example, a graphic editing window, many musicians avoid them. These powerful tools, however, enable you to tweak large amounts of data with a few quick mouse-clicks, rather than having to spend time massaging your MIDI data one event at a time in an event list.

Image placeholder title

FIG. 1: Shown below is the Logical Editor in Cubase. The pop-up menu shows the tests that can be performed on events.

Logical edit utilities go by various names in different sequencers. In Apple Logic, those functions are found in the Transform window. Steinberg Cubase provides a Logical Editor (see Fig. 1). In Cakewalk Sonar, the Process>Interpolate menu command brings up the Event Filter, which has two windows that are almost identical to each other: Search (see Fig. 2) and Replace.

Newer virtual-workstation multitrack programs such as Propellerhead Reason, Ableton Live, and Arturia Storm, which work primarily with audio files, usually don't have logical edit utilities; that is because logical edit utilities are considered to be a legacy feature that dates back to the earliest days of MIDI sequencing. Advanced MIDI editing was a necessity when computers weren't yet fast enough to handle CD-quality audio.

Details on how these utilities operate may differ wildly from one sequencer to another. Consult your owner's manual for specifics. In this column, we'll look at the underlying concepts that are common to logic-based MIDI editing.

MIDI Two-Step

Logical editing is a two-step process: first you specify which events you want to edit, then you specify what will be done to those events during the edit operation. The criteria used for selecting events and the operations performed on them can be quite sophisticated. That is what makes logical editing powerful and tricky to understand.

Image placeholder title

FIG. 2: Pictured below is Sonar''s Event Filter. In this screen shot, the filter is set up to choose CC1 events whose value is between 63 and 127.

Suppose you're using a MIDI guitar controller or a pitch-to-MIDI interface that sometimes outputs extraneous notes. Those notes will have extremely short durations or low Velocity values, and so they may not be very audible. Depending on the synth you're using for playback, however, they can still affect the performance in undesirable ways. Using a logical editor, you can select all of the notes within a MIDI track that are extremely short (only a few clock-ticks in length) or that have unusually low Velocity values. Having selected those notes, you can then delete them. With logical editing, you can select such notes throughout the track in a single operation rather than having to visually scan for them and Shift-click on each note.

Perhaps you're using a percussion-oriented synth to play a drum track, and you'd like the snare hits on beat 3 to be more laid-back. Logical editing lets you select only notes that are on or near beat 3, and then push their start times back by a few clock-ticks — without changing the timing of any other drums in the track. You may also choose to raise or lower those notes' Velocity values during the same operation.

What if your MIDI keyboard is sending out tons of Aftertouch or Channel Pressure data that's being recorded onto your tracks? Given the speed of today's computers, that may not matter. You may not even notice. But if you later change to a synth preset that responds to Aftertouch in some way, the Aftertouch data may create a sonic nuisance. With logical editing, you can select only the Aftertouch events in the track and delete them, without affecting the notes and other controller data.

A Select Group

Typically, logical edit utilities let you select events using most or all of the following criteria:

  • Time position in the track as a whole (for instance, between bar 7, beat 1 and bar 19, beat 3)
  • Time position within any bar (for instance, between beat 2, tick 117 and beat 3, tick 5)
  • Event type (for instance, notes or Pitch Bend data)
  • Length (applies only to notes)
  • MIDI channel
  • Value 1
  • Value 2

The meanings of value 1 and value 2 will change depending on the event type selected. If the event type is Note On, value 1 is the note value and value 2 is the Velocity. If the event type is Control Change, value 1 is the CC number and value 2 is the data value of a given CC message. If the event type is Channel Pressure, there is no value 2, because Channel Pressure is a 2-byte MIDI message and has only one data byte.

With parameters that have numeric values, such as note length and the two data values, you'll be able to apply various mathematical or logical tests to the events. The tests will include some or all of the following:

  • Equal to
  • Not equal to
  • Less than
  • Greater than
  • Within a range of values
  • Outside of a range of values

To use the last two types of tests, you'll need to specify two data values. For instance, you might choose notes within the pitch range of C2 to C4. If you select those two data values and then use the “within a range of values” test, notes only between C2 and C4 will be selected for editing. If you use the “outside of a range of values” test, then notes between C2 and C4 will not be affected by a subsequent editing operation, while higher and lower notes will be edited. In Sonar, you switch from inside the selected range to outside the range by clicking on the “exc” (exclude) checkbox.

If you've specified two or more criteria, you'll be able to connect them using logical AND or logical OR operations. (Also possible, though less likely, are NOR and XOR operations.) These are called Boolean operations, which is why the Cubase Logical Editor has a column labeled “bool.” Here is how those choices operate:

  • AND: The event is selected only if it meets both of the criteria that you've specified.
  • OR: The event is selected if it meets either criterion.
  • NOR: The event is selected only if it meets neither of the criteria.
  • XOR: The event is selected only if it meets exactly one of the two criteria and does not meet the other.

Operating Room

Now that you've selected some MIDI events, what would you like to do with them? The possibilities here are somewhat more visionary. Your sequencer may offer some or all of the following choices:

  • Delete
  • Copy
  • Replace with another event type
  • Move forward or backward in time
  • Quantize time position
  • Change event type (for instance, from Pitch Bend to Aftertouch)
  • Change channel
  • Operate mathematically on value 1
  • Operate mathematically on value 2
  • Reverse time position
  • Invert around a center value

The options to perform mathematical operations on values 1 and 2 are very useful. By adding 12 to value 1 of a note event, for example, you can transpose it up by an octave. But addition and subtraction are just the beginning. By using multiplication or division with controller data, you can keep the contour of a controller sweep while reducing or expanding the height of the sweep. Other mathematical operations found in some sequencers include randomization and tapering (also called interpolation). With the latter, wild swings in controller data can be turned into a smooth ramp.

The Event Horizon

Logical editing isn't something most of us use every day, but if you're using MIDI tracks, it would be well worth your while to spend a little time getting familiar with this feature in your sequencer, so that you can take advantage of it when you need it. Most logical edit utilities allow presets to be stored, which makes it easy to create a library of the edits you use most often. The groundswell of interest in software-based synthesizers in the past few years has given new life to MIDI, making logical editing an invaluable weapon in the arsenal of any power user.

Jim Aikin is the author of Power Tools for Synthesizer Programming (Backbeat Books, 2004) and A Player's Guide to Chords & Harmony: Music Theory for Real-World Musicians (Backbeat Books, 2004). Visit Jim online