When the MIDI spec was first developed, it wasn't foreseen that anyone would need more than 128 patches on a given module. (Back then, most didn't even have anywhere near that number of patches). So, the MIDI Program Change message was hardwired to have a limit of counting only from 1 to 128. Musicians simply used a MIDI Program Change message to change the patch over MIDI, and this was all that was needed initially.

Later, modules with more than 128 patches came on the market. People needed some way of being able to switch to these extra patches, but which was still compatible with the old way of switching patches. The manufacturers adopted a scheme of arranging patches in "banks" (ie, groups of usually 128 patches). For example, the first 128 patches in a module may be "bank 1". The next 128 patches may be "bank 2". Etc. Theoretically, there can be up to 16,384 banks on a module (ie, a total of 2,097,152 patches arranged into 16,385 banks of 128 patches each).

Bank Select Controller

The technique that the manufacturers adopted for MIDI control over patch changing is to have the musician first select the bank that contains his desired patch, and then select the patch within that bank. For example, assume that a musician wants to select the patch "Gungho" which happens to be the third patch in the second bank. First the musician would have to send one or two (depending upon how the manufacturer arranged patches into banks) MIDI messages to select the second bank. (NOTE: MIDI counts this as bank 1, since MIDI considers bank number 0 to actually be the first bank). Then, the musician sends a MIDI message to select the third patch. (NOTE: MIDI also considers patch number 0 to be the first patch in a bank, so the third patch would actually be number 2). So, selecting a patch is a two-step (ie, 2 or 3 message) process. First, you send the Bank Select message(s) to switch to the desired bank. Then you send an ordinary Program Change message to select which one of the 128 possible patches in that bank you desire.

The Bank Select messages are actually MIDI Controller messages, just like Volume, Pan, Sustain Pedal, Wind, and other controllers. Specifically, the controller number for the "Most Significant Byte" (ie, MSB) of Bank Select is controller 0. The controller number for "Least Significant Byte" (ie, LSB) of Bank Select is controller 32. The data for these messages are the bank number you want to select. (Sometimes the MSB Bank Select is referred to as the coarse adjustment for bank, and the LSB Bank Select is referred to as the fine adjustment).

NOTE: We need to use 2 messages to contain the bank number because, due to MIDI's design, it's not possible to transmit a value greater than 128 in just one controller message. Remember that a bank number can go as high as 16,384, and you need 2 MIDI controller messages to send such a large value. But, since most modules do not have more than 128 banks anyway, these modules typically use only the MSB message (ie, controller number 0) to select bank, and ignore any LSB message (ie, controller number 32). Here then are the two messages (in hexadecimal, assuming MIDI channel 1, and assuming that the module only uses the MSB Bank Select controller) to select that "Gungho" patch:

B0 00 01Switch to bank 2 (NOTE: only the MSB message needed)
C0 02Switch to the third patch in this bank

The patch doesn't actually change until the module receives the Program Change message. The Bank Select message(s) must precede the Program Change message. Otherwise, the module would select the third patch in whatever bank the module was currently set to. (In other words, when the module receives Bank Select messages, it doesn't change any patches. Rather, it simply notes what the "current bank" is, and any subsequent Program Change messages will switch to patches within that bank. What this also means is that you don't necessarily need to send Bank Select before every individual Program Change. If you're switching to a patch in the same bank as whatever patch you've currently selected, then you can omit the Bank Select messages since the module will then assume the same bank).

Different modules will typically have different banks of patches. The only standards for which patches appear in a given bank is General MIDI (GM), Roland's GS, and Yamaha's XG. And even if a module does have a GM Bank of patches, it doesn't necessary have to assign this a specific bank number. (For example, the GM patches on one module could be assigned to bank #3, and on another module, its GM patches could be placed into bank #0. Sure, both banks will contain the same 128 patches, but you'll have to use different bank numbers for the two modules to select their GM banks). And although most all modern modules use Bank Select controllers to switch banks, as mentioned, some only use the MSB, and some (such as Roland as you'll see below) have a rather clever way of utilizing the wide range of bank numbers that are possible using both the MSB and LSB controllers. So, to discover which bank number (and which bank controllers) you need to select a specific patch, you'll have to check your module's user manual. Look in the MIDI implementation section for Bank Select Controller. There may likely be some sort of chart showing which bank controllers to use, what numbers to use with those ontrollers, and which program change numbers to use, to select certain patches.

A Roland example of patch changing

The following, real-world example concerns a Roland module. Before proceeding, you should read The architecture of Roland sound modules if you're unfamiliar with the way that Roland arranges Patches into "Banks".

Let's study the JV-90 as an example. Look under the "MIDI Implementation" chapter of the manual. Follow the "Receive Data" section until you get to "Control Change" and "Bank Select". (The article Understanding the MIDI Implementation in your Roland manual helps guide you through this chapter of the manual). As is so typical of Roland, the company uses the MIDI spec in a clever way. Rather than using the data bytes of both the MSB and LSB messages "added" together to make up a single bank number, Roland sort of uses the MSB message to select the "component" that you wish to access, and the LSB message to select the bank within that component (ie, some components contain several banks, such as the factory patches in ROM).

Look at the following list:

Bank
MSB
Bank
LSB
Program
Change
Media
8001 - 64Internal (ie, User custom presets in RAM)
80065 - 128Data Card
8101 - 64JV-90 Preset A (ie, factory patches on Voice Expansion)
81065 - 128JV-90 Preset B (ie, factory patches on Voice Expansion)
8111 - 64Preset A (ie, factory patches in ROM)
81165 - 128Preset B (ie, factory patches in ROM)
8121 - 64Preset C (ie, factory patches in ROM)
81265 - 128Preset D (ie, factory patches in ROM)
8201 - 64Data Card
8301 - 128PCM Card
8401 - 128Expansion Board (ie, factory patches on Wave Expansion)
8411 - 128Expansion Board (129 - 256)

Let's say that you want to select the third patch on the factory presets "B" group. Look at "Preset B". In order to select from these patches, first you must send an MSB Bank Select with the decimal value 81 (ie, hexadecimal 51). Next, you must send an LSB Bank Select with the value 1. Finally, you can send a Program Change. The patches in this bank are numbered 65 to 128 (ie, the first patch in the "Preset B" is number 65 -- actually it is 64 in our Program Change message since we always subtract 1 to account for MIDI assuming 0 as the first patch in a bank). So the third patch in Preset B is #67 (really 66, or hexadecimal 42). Here are the 3 messages (assuming MIDI channel 1):

B0 00 51MSB (Coarse) Bank select
B0 20 01LSB (Fine) Bank select
C0 42Program Change

Let's select the first patch in User RAM (ie, "Internal" as Roland calls it in the above chart). We need an MSB Bank Select of 80 (hexadecimal 50), an LSB Bank Select of 0, and then a Program Change to patch 1 (actually 0) since the patches are numbered 1 to 64 here.

B0 00 50MSB (Coarse) Bank select
B0 20 00LSB (Fine) Bank select
C0 00Program Change

If you subsequently want to select another patch in this same bank, then you can skip sending the 2 Bank Select messages. After all, "User RAM" is now the current bank.

Although most Roland sound modules use Bank Select controller in ways similiar to the JV-90, your unit may have different components and different bank numbers used to select them. You need to look up the appropriate chart in your Roland manual. It will be found in the "MIDI Implementation" chapter, under the RECEIVE DATA main section, CONTROL CHANGE subsection, and "Bank Select" sub-subsection.

Definition Files

Some sequencer programs allow you to setup an "instrument definition" wherein you simply enter the above 3 messages and then specify the name of the patch. For example, maybe this patch is called "Gungho". You can tell your sequencer that whenever you select "Gungho" from a list of patch names, the sequencer will then automatically insert the above 3 messages into your track at some specified point where you want to switch to the "Gungho" patch. It's a lot easier to setup that instrument definition once, detailing the messages to insert for each patch name, and then from there, deal only with selecting patch names from some list rather than needing to remember what Bank Select and Program Change messages need to be inserted. But of course, in order to create such a definition, you need to understand the above (once anyway -- and then you can forget about it all -- after the nightmares subside).

Different sequencer programs have different interfaces for creating their "instrument definitions", and they likely have different formats for storing this information (so you can't use one program's definition with another program. There is no standard for instrument definitions. My own "GenMidi" DLL, available on this web site, is meant to be used by programmers to address this issue. All programs that use this DLL can share one database of instrument definitions).

CakeWalk example of Definition Files

Here's an example of creating an instrument definition for the JV-90 in CakeWalk Pro Audio 9.0.

Go into CakeWalk's Options->Instruments menu item. (Earlier versions of Cakewalk had this item as the Settings->Assign Instruments menu item).

This will pop up a dialog box listing the names of all the currently defined instrument definitions (in the box labeled "Uses Instrument". It also lists the names of all of the available MIDI ports (ie, busses) and their 16 channels (in the box labeled "Port/Channel"). An line inbetween the two boxes shows you which instrument definition is in use by each Port/Channel. (ie, In CakeWalk, each MIDI channel can have a different instrument definition assigned to it. What that means is that, when you enter an event to change a patch in some track, the list of patch names presented to you will depend upon what MIDI Port/Channel that track is assigned to, and what instrument definition is assigned to that Port/Channel).

Above, I have one Port (ie, one MIDI Output buss) whose name is "MPU-401". It has 16 MIDI channels. The first MIDI channel on this port is selected in the dialog, and the line between the boxes reveals that the instrument definition named "General MIDI" is assigned to this Port/Channel. Therefore whenever I assign a CakeWalk track to this Port and MIDI Channel, and I insert a patch change event in this track, then the patch names presented to me will be for the General MIDI patch set.

If your desired instrument is not included in the list of defined instruments, then you'll have to locate such a definition and add it to CakeWalk's database, or create a definition yourself. Let's try the latter approach.

Since you wish to create a new definition, click on the "Define..." button. This brings up the following dialog in CakeWalk 9.0. (NOTE: In previous versions, there was a demonstrably different, and much less user-friendly dialog. Those versions had a very convoluted manner of creating a definition because you have to first dig your way down to the "Define names" dialog box, skipping a whole dialog of settings, in order to enter all the banks of patch names prior to even defining what sort of bank select your module uses and what those banks are. This "bottom up" approach may save some time if you're dealing with a module whose banks tend to include a lot of duplicate patches, but it's really a pain for modules whose banks do not contain duplicate patches. I prefer to first choose the "bank select method", and then have CakeWalk guide me through the naming/numbering of a bank, immediately followed by each patch name/number in that bank, and so on for however many more banks there are. Worse, it appears that you have to enter the Banks by editing a rather freeform text file. For this reason, the creation of CakeWalk instrument definitions in versions prior to 9.0 is a perilous and difficult undertaking for all but the most patient and experienced. This tutorial will not focus upon those versions).

In the above dialog box, the names of all the currently defined instrument definitions are listed in the left box under a folder labeled "Instruments". A box to the right has numerous folders labeled "Patch names", "Note names", "Controller names", "RPN Names", "NRPN Names", and "Bank Select Methods". The latter are the "raw materials" from which you pick and choose to create an instrument definition.

To create a new instrument, move the mouse pointer over the box listing the Instruments, and click the right mouse button. This should pop open a menu as below. Select "New instrument".

This will insert a new instrument into the list, and you are prompted to give it any name of your choosing.

If you double-click on the new instrument's name, its folder will expand, showing you the properties that make up this instrument definition. When you first create an instrument, it is given a default set of properties, as shown below:

An instrument has one or more banks of patch names. In "Patch names" is where you enter the bank controller and program numbers for each patch (name).

Once you have an instrument definition, you can insert a Bank Select (MSB and LSB) and Program Change in a CakeWalk track simply using the Insert menu's "Bank/Patch change".

The very first Bank Select and Program Change events, if they appear before any note events in a track, are automatically extracted by CakeWalk and used to set the "Bank" and "Patch" fields in CakeWalk's track display. So, you use these two fields to enter your values for any initial Bank and Program Change at playback start. Then, if you want to change the Bank and/or Patch somewhere in the middle of the track (ie, after notes have already been played, you'll have use CakeWalk's Insert menu to insert "Bank/Patch change". Choose a Bank and a Patch, and enter the desired time where it should be inserted, and CakeWalk will insert the Bank Select and Program Change events in the track at that desired point. You should see these shown in the Event List. If you don't have a CakeWalk instrument definition file for your MIDI module, then you'll need to manually insert the desired Bank controller events yourself using Insert menu's "Series of Controllers". Do this once to choose "Bank Select" controller (ie, the coarse, or MSB one) and its desired Value and Time. (If your unit also requires the LSB or "fine" value for Bank Select, you'll need to repeat this to choose "Bank Select (fine)" controller and set its value/time). Then use the "Bank/Patch change" just to pick out one of the 128 patches in the bank.