MP3 to MIDI Program Numbers: Sixteen Families, 128 Slots, Two Controllers
A MIDI file names its instrument with one seven-bit number, so the list stops at 128. Everything past that comes from two separate control messages rather than a wider field, and the second set of 128 sounds exists only where the receiver understands them.
Short answer
- One byte, 128 values. Program Change is a channel message with a single seven-bit data byte, and the specification calls that byte the new program number.
- Sixteen families of eight. The General MIDI patch map divides the 128 into sixteen families of eight programs each, tiling the list from 1 to 128.
- The bank is two other messages. Bank Select is controller 0 for the high byte and controller 32 for the low byte, each 0 to 127, so the pair addresses 128 times 128 banks.
- 256 sounds, same byte. Level 2 adds a second set of 128 melodic sounds in variation banks, for a total of 256, without widening the program-change byte.
One byte names the instrument, and it is seven bits wide
Program Change is 1100nnnn 0ppppppp: a channel message carrying one data byte,
which the specification calls the new program number. Seven bits gives 128 values, and the
General MIDI patch map assigns all 128. Because the message is a channel message, each of the
sixteen channels can hold a different program at the same time. The map groups those sounds
into families of eight, and the ranges tile the list exactly, from 1 to 8 for piano through
121 to 128 for sound effects. Those names are the same on every channel except channel 10,
where the patch map is replaced by percussion rather than extended.
The bank is not in that message
A program number alone reaches only the first 128 slots. The bank is addressed separately, by two Control Change messages instead of one field: controller number 0 carries the most significant byte and controller number 32 the least significant. Both are seven-bit controllers ranging from 0 to 127, so the pair addresses 128 times 128 distinct banks, 16,384 in all. The extension text describes the same pair as specifying up to 65536 variation sounds; the address space the two controllers provide is the 16,384 above.
Bank select is not on General MIDI's own list
The pair is not a General MIDI invention: it sits in the base MIDI 1.0 controller table as Bank Select, controller 0 for the MSB and 32 for the LSB. The notable part runs the other way. The list of controllers General MIDI Level 1 interprets has eleven entries, numbered 1, 6, 7, 10, 11, 38, 64, 100, 101, 121 and 123, and neither 0 nor 32 is among them. A device can meet every stated Level 1 requirement and still have no obligation to act on a bank message.
Level 2 reaches 256 without widening the message
Level 2 keeps the program-change byte at seven bits and adds a second set of 128 melodic sounds in variation banks, for a total of 256. The specification gives the route: set controller 32 to 121, then controller 0 to select the bank, before the Program Change. One specific low-byte value is therefore the documented door to the extra sounds.
Two messages, in that order
Because the bank lives in two Control Change messages, it cannot travel with the program number, and the wording places it before the Program Change. A program change that arrives first is resolved against whatever bank the receiver was already using, and nothing in the file records which bank a listener will hear.
What this means for a converted file
None of the note data carries timbre. Note On is 1001nnnn 0kkkkkkk 0vvvvvvv: a
key number, a velocity and a channel, and nothing about which instrument plays. The instrument
is a separate message sent ahead of the notes, and it names one of 128 slots per channel
unless the file also writes a bank. A converter that writes a program change has chosen a
position in a list of 128, inside a bank the receiver has to resolve.