MP3 to MIDI: The One Controller That Stores a Key Number

A slide between two notes is audible on the recording and absent from the converted file, and the gap is not precision. In the Standard MIDI File controller table, 127 of its 128 rows hold an amount, a switch state, a fixed zero or nothing at all. The exception is controller 84, Portamento Control, whose value column reads Source Note. That number is a key, not a level.

Short answer

  • One row in 128 is not a level. Controller 84 stores a key number. Rows 83 and 85 on either side both store 0-127.
  • The message names where a glide starts, not where it ends. The destination is the next Note On on the same channel, and no field in the controller holds it.
  • General MIDI Level 1 does not require it. Its eleven-controller list runs 1, 6, 7, 10, 11, 38, 64, 100, 101, 121, 123, and holds none of 5, 37, 65 or 84.
  • A converter that writes attacks has nowhere to put it. A slide comes back as separate notes, or not at all.

128 rows, one of them a key

Appendix 1.2 lists the controllers in numerical order, 128 rows from 0 to 127. Ninety-three rows read 0-127 in the value column. Eighteen read a question mark: controllers 102 to 119, all Undefined. Six read 63=off, 64=on. Six read a fixed 0. Two read N/A. One reads 0=off, 127=on. One reads a pair of asterisks. One reads Source Note. That cell belongs to row 84, and it is the only row in the table whose value column is not an amount, a state or a null. The seven-bit data byte holds 128 values; the note table in Appendix 1.3 has 128 rows, so the fit is exact.

Where a glide ends is a separate message

Controller 84 names the key to start from. It does not name the key to arrive at, and it holds no duration. The destination is the next Note On on that channel; the speed is controller 5, with 37 as its fine half; 65 switches the effect on. Three Control Change messages at three bytes each, then the Note On at three, so twelve bytes carry one glide. The field is channel-wide as well: with two keys held on one channel, it cannot say which of them slides.

The specification never explains it

Portamento Control appears once in the document, in that table cell. Source Note appears once, in the same cell. Glide appears zero times. Those four rows are the entire text: 5 and 37 for time, 65 for on and off, 84 for the key. A reader has a column heading and a neighbouring appendix, and nothing else.

General MIDI does not require any of it

General MIDI's controller list names eleven numbers: 1, 6, 7, 10, 11, 38, 64, 100, 101, 121 and 123. None of 5, 37, 65 or 84 is among them. The controller table's asterisk footnote marks the rows an instrument must answer to comply with General MIDI Level 1, and none of the four portamento rows carries the asterisk. General MIDI mentions the effect once, in its account of the GS extensions: portamento, sostenuto, soft pedal (cc#65-67), filed as an addition. On a Level 1 device these messages are legal and may do nothing.

How to tell which one you have

A stored glide leaves a controller event, not a run of notes. Look for the byte pair B0 54: B0 is Control Change on channel 1, and 54 hex is 84. If it is absent, no glide is stored on that channel, whatever the recording did. If it is present, the third byte is the starting key and the next Note On is the arrival. A slide written as separate notes looks different: a ladder of short Note On and Note Off pairs, one per step. Only the first of the two is in the file.

Related