MP3 to MIDI Volume, Pan and Expression: Three Fields the Note List Cannot Hold

A converted MIDI file carries loudness in two unrelated places. Velocity sits inside each note. Volume, pan and expression are control change messages with no note number in them at all, so they apply to every note sounding on that channel at that instant.

Volume, pan and expression, answered

  • Three field numbers, each 0 to 127. Controller 7 is Channel Volume, formerly Main Volume; controller 10 is Pan; controller 11 is the Expression Controller.
  • None of them can name a note. The message shape is 1011nnnn 0ccccccc 0vvvvvvv, so there is no key-number field anywhere in it. Channel-wide by construction.
  • General MIDI Level 1 makes all three mandatory. Nine controllers carry an asterisk whose footnote states that equipment must respond in order to comply with General MIDI level 1, and 7, 10 and 11 are three of the nine.
  • Pan is named, and the middle is not. The specification gives the range 0-127 and never says where the middle sits.

The message has no room for a note number

Control Change is 1011nnnn 0ccccccc 0vvvvvvv. The second byte is the controller number and the third is a value from 0 to 127; the specification describes it as sent when a controller value changes. Note On is 1001nnnn 0kkkkkkk 0vvvvvvv, and the same document labels that byte the key number. A control change has no equivalent field, so it cannot name one note.

A velocity is written once per note; a volume, pan or expression change is written once per channel, on everything sounding there.

Three of the fields General MIDI requires

The controller table marks nine entries with an asterisk, and the footnote under it states that equipment must respond in order to comply with General MIDI level 1. Three of the nine are 7 Channel Volume, 10 Pan and 11 Expression Controller. The General MIDI specification's list of the controllers it specifies names eleven: those nine plus 6 Data Entry MSB and 38 Data Entry LSB.

The mandate comes from the footnote rather than the headline. Level 1's four-item minimum list asks for 24 voices, a response to note velocity, all 16 channels and polyphony; volume, pan and expression appear nowhere in it.

The specification names Pan, not the middle

The table lists controller 10 as Pan, range 0-127 MSB, and nothing more. The word center occurs zero times in the document. So the standard gives the range and not the middle: 128 values are named, and which of them sits in the centre is not stated. What a converter writes there can be checked against a convention, not against the standard.

Being per channel rather than per note, it cannot place one instrument in a stereo image by itself. A file that separates a recording into parts puts them on different channels, which gives controller 10 something to move.

The fields multiply, and only one is per note

Velocity is 7 bits, volume is 7 bits, expression is 7 bits. The three are independent fields, so together they span 128 times 128 times 128, or 2,097,152 combinations, against 128 for a velocity alone. The arithmetic describes the field space, not what an ear hears: the specification fixes resolutions, not loudness.

Order matters too. A velocity is read once, when the key goes down; a control change is read when it arrives, so the same message moves notes that are already sounding. A file that needs a crescendo must therefore choose between editing velocities note by note and writing a channel curve.

What to count in a downloaded file

Count the 7, 10 and 11 messages. If it contains none of them, all of the loudness sits in the velocities and the channel defaults apply. The table also separates ranges from switches: controllers 7, 10 and 11 take any of the 128 values, while 121 Reset All Controllers and 123 All notes off both show one fixed value, 0.

Related